Unit HIDJOYSTICK

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


Ultibo HID Joystick and Gamepad Consumer unit

This is a consumer for any generic HID joystick or gamepad device, it accepts HID application collections in the generic desktop page (HID_PAGE_GENERIC_DESKTOP) with the usage set to joystick (HID_DESKTOP_JOYSTICK) or gamepad (HID_DESKTOP_GAMEPAD).

The consumer will bind to any joystick or gamepad collection that implements at a minimum the X and Y axis and at least one button.

This consumer doesn't support certain well known gamepad devices such as the Xbox or PlayStation controllers that have specific control and button mappings and may require special command sequences to enable certain features. The option to create an additional driver that has specific support for some of those devices is being considered.

Constants



[Expand]
HID joystick specific constants HID_JOYSTICK_*


Type definitions



HID joystick device

[Expand]

PHIDJoystickDevice = ^THIDJoystickDevice;

THIDJoystickDevice = record


Public variables


None defined

Function declarations



Initialization functions

[Expand]
procedure HIDJoystickInit;
Description: Initialize the HID Joystick unit and HID Joystick driver


HID joystick functions

[Expand]
function HIDJoystickStart(Joystick:PJoystickDevice):LongWord;
Description: Implementation of JoystickDeviceStart API for HID Joystick device


[Expand]
function HIDJoystickStop(Joystick:PJoystickDevice):LongWord;
Description: Implementation of JoystickDeviceStop API for HID Joystick device


[Expand]
function HIDJoystickUpdate(Joystick:PJoystickDevice):LongWord;
Description: Implementation of JoystickDeviceUpdate API for HID Joystick device


HID joystick helper functions

[Expand]
function HIDJoystickCheckCollection(Collection:PHIDCollection):LongWord;
Description: Check if a HID collection is suitable for use as a joystick device


[Expand]
function HIDJoystickCheckDefinition(Definition:PHIDDefinition):LongWord;
Description: Check if a HID definition is suitable for use as a joystick input report


Return to Unit Reference