Difference between revisions of "Unit Joystick"
Line 18: | Line 18: | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick specific constants''' <code> JOYSTICK_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>JOYSTICK_NAME_PREFIX = 'Joystick';</code> | ||
+ | | Name prefix for Joystick Devices | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick device types''' <code> JOYSTICK_TYPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>JOYSTICK_TYPE_NONE = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>JOYSTICK_TYPE_JOYSTICK = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_TYPE_GAMEPAD = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>JOYSTICK_TYPE_MAX = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Joystick Type Names'' | ||
+ | |- | ||
+ | |colspan="2"|<code>JOYSTICK_TYPE_NAMES:array[JOYSTICK_TYPE_NONE..JOYSTICK_TYPE_MAX] of String = ('JOYSTICK_TYPE_NONE', 'JOYSTICK_TYPE_JOYSTICK', 'JOYSTICK_TYPE_GAMEPAD');</code> | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick device states''' <code> JOYSTICK_TYPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>JOYSTICK_STATE_DISABLED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>JOYSTICK_STATE_ENABLED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>JOYSTICK_STATE_MAX = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Joystick State Names'' | ||
+ | |- | ||
+ | |colspan="2"|<code>JOYSTICK_TYPE_NAMES:array[JOYSTICK_TYPE_NONE..JOYSTICK_TYPE_MAX] of String = ('JOYSTICK_TYPE_NONE', 'JOYSTICK_TYPE_JOYSTICK', 'JOYSTICK_TYPE_GAMEPAD');</code> | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick device flags''' <code> JOYSTICK_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>JOYSTICK_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_FLAG_NON_BLOCK = $00000001;</code> | ||
+ | | If set device reads are non blocking (Also supported in Flags parameter of JoystickDeviceRead) | ||
+ | |- | ||
+ | | <code>JOYSTICK_FLAG_PEEK_BUFFER = $00000002;</code> | ||
+ | | Peek at the buffer to see if any data is available, don't remove it (Used only in Flags parameter of JoystickDeviceRead) | ||
+ | |- | ||
+ | | <code>JOYSTICK_FLAG_LED = $00000004;</code> | ||
+ | | If set the device contains one or more LEDs | ||
+ | |- | ||
+ | | <code>JOYSTICK_FLAG_RGBLED = $00000008;</code> | ||
+ | | If set the device contains one or more RGB LEDs | ||
+ | |- | ||
+ | | <code>JOYSTICK_FLAG_RUMBLE = $00000010;</code> | ||
+ | | If set the device has rumble or force feedback | ||
+ | |- | ||
+ | | <code>JOYSTICK_FLAG_GYROSCOPE = $00000020;</code> | ||
+ | | If set the device contains a gyroscope | ||
+ | |- | ||
+ | | <code>JOYSTICK_FLAG_TOUCHPAD = $00000040;</code> | ||
+ | | If set the device contains a touchpad | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''Flags supported by JOYSTICK_CONTROL_GET/SET/CLEAR_FLAG'' | ||
+ | |- | ||
+ | |colspan="2"|<code>JOYSTICK_FLAG_MASK = JOYSTICK_FLAG_NON_BLOCK or JOYSTICK_FLAG_LED or JOYSTICK_FLAG_RGBLED or JOYSTICK_FLAG_RUMBLE or JOYSTICK_FLAG_GYROSCOPE or JOYSTICK_FLAG_TOUCHPAD;</code> | ||
+ | |- | ||
+ | | <code>NAME</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick device control codes''' <code> JOYSTICK_CONTROL_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_GET_FLAG = 1;</code> | ||
+ | | Get Flag | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_SET_FLAG = 2;</code> | ||
+ | | Set Flag | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_CLEAR_FLAG = 3;</code> | ||
+ | | Clear Flag | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_FLUSH_BUFFER = 4;</code> | ||
+ | | Flush Buffer | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_GET_HAT = 5;</code> | ||
+ | | Get the name (identifier) associated with a Hat | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_SET_HAT = 6;</code> | ||
+ | | Set the name (identifier) associated with a Hat | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_GET_AXIS = 7;</code> | ||
+ | | Get the name (identifier) associated with an Axis | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_SET_AXIS = 8;</code> | ||
+ | | Set the name (identifier) associated with an Axis | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_GET_BUTTON = 9;</code> | ||
+ | | Get the name (identifier) associated with a Button | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_SET_BUTTON = 10;</code> | ||
+ | | Set the name (identifier) associated with a Button | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_GET_CALLBACK = 11;</code> | ||
+ | | Get the registered callback function for joystick events | ||
+ | |- | ||
+ | | <code>JOYSTICK_CONTROL_SET_CALLBACK = 12;</code> | ||
+ | | Set the registered callback function for joystick events | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick buffer size''' <code> JOYSTICK_BUFFER_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUFFER_SIZE = 2048;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick xxis, hat and button maximum''' <code> JOYSTICK_MAX_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>JOYSTICK_MAX_AXIS = 16;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>JOYSTICK_MAX_HAT = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_MAX_BUTTON = 32;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick default minimum and maximum''' <code> JOYSTICK_DEFAULT_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>JOYSTICK_DEFAULT_MINIMUM = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>JOYSTICK_DEFAULT_MAXIMUM = 255;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick and Gamepad axis names''' <code> JOYSTICK_AXIS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Includes Buttons, Sliders, Wheels etc that report an analog value)'' | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_NONE = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_1 = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_2 = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_3 = 3;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_4 = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_5 = 5;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_6 = 6;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_7 = 7;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_8 = 8;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_9 = 9;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_10 = 10;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_11 = 11;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_12 = 12;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_13 = 13;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_14 = 14;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_15 = 15;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_16 = 16;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_X = 17;</code> | ||
+ | | X | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_Y = 18;</code> | ||
+ | | Y | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_Z = 19;</code> | ||
+ | | Z | ||
+ | |- | ||
+ | | <code>JOYSTICK_ROTATION_X = 20;</code> | ||
+ | | Rotation X | ||
+ | |- | ||
+ | | <code>JOYSTICK_ROTATION_Y = 21;</code> | ||
+ | | Rotation Y | ||
+ | |- | ||
+ | | <code>JOYSTICK_ROTATION_Z = 22;</code> | ||
+ | | Rotation Z | ||
+ | |- | ||
+ | | <code>JOYSTICK_SLIDER = 23;</code> | ||
+ | | Slider | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>GAMEPAD_AXIS_LEFT_X = 24;</code> | ||
+ | | Left X | ||
+ | |- | ||
+ | | <code>GAMEPAD_AXIS_LEFT_Y = 25;</code> | ||
+ | | Left Y | ||
+ | |- | ||
+ | | <code>GAMEPAD_AXIS_X = GAMEPAD_AXIS_LEFT_X;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_AXIS_Y = GAMEPAD_AXIS_LEFT_Y;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_AXIS_RIGHT_X = 26;</code> | ||
+ | | Right X | ||
+ | |- | ||
+ | | <code>GAMEPAD_AXIS_RIGHT_Y = 27;</code> | ||
+ | | Right Y | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_LT = 28;</code> | ||
+ | | Left Trigger analog button | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_L2 = GAMEPAD_CONTROL_LT;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_RT = 29;</code> | ||
+ | | Right Trigger analog button | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_R2 = GAMEPAD_CONTROL_RT;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_UP = 30;</code> | ||
+ | | Up analog button | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_RIGHT = 31;</code> | ||
+ | | Right analog button | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_DOWN = 32;</code> | ||
+ | | Down analog button | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_LEFT = 33;</code> | ||
+ | | Left analog button | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_L1 = 34;</code> | ||
+ | | L1 analog button | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_R1 = 35;</code> | ||
+ | | R1 analog button | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_TRIANGLE = 36;</code> | ||
+ | | Triangle analog button | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_CIRCLE = 37;</code> | ||
+ | | Circle analog button | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_CROSS = 38;</code> | ||
+ | | Cross analog button | ||
+ | |- | ||
+ | | <code>GAMEPAD_CONTROL_SQUARE = 39;</code> | ||
+ | | Square analog button | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_MAX = 39;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''Joystick and Gamepad Axis Names'' | ||
+ | |- | ||
+ | | <code>JOYSTICK_AXIS_NAMES:array[JOYSTICK_AXIS_NONE..JOYSTICK_AXIS_MAX] of String = (</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_NONE',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_1',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_2',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_3',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_4',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_5',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_6',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_7',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_8',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_9',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_10',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_11',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_12',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_13',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_14',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_15',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_16',</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_X',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_Y',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_AXIS_Z',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_ROTATION_X',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_ROTATION_Y',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_ROTATION_Z',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_SLIDER',</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>'GAMEPAD_AXIS_LEFT_X',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_AXIS_LEFT_Y',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_AXIS_RIGHT_X',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_AXIS_RIGHT_Y',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_LT',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_RT',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_UP',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_RIGHT',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_DOWN',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_LEFT',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_L1',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_R1',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_TRIANGLE',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_CIRCLE',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_CROSS',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_CONTROL_SQUARE');</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick and Gamepad hat names''' <code> JOYSTICK_HAT* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>JOYSTICK_HAT_NONE = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_HAT_1 = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_HAT_2 = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_HAT_3 = 3;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_HAT_4 = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>JOYSTICK_HAT_POV = 5;</code> | ||
+ | | Point of View (POV) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>JOYSTICK_HAT_MAX = 5;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''Joystick and Gamepad Hat Names'' | ||
+ | |- | ||
+ | | <code>JOYSTICK_HAT_NAMES:array[JOYSTICK_HAT_NONE..JOYSTICK_HAT_MAX] of String = (</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_HAT_NONE',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_HAT_1',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_HAT_2',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_HAT_3',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_HAT_4',</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>'JOYSTICK_HAT_POV');</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick and Gamepad button names''' <code> JOYSTICK_BUTTON_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_NONE = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_1 = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_2 = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_3 = 3;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_4 = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_5 = 5;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_6 = 6;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_7 = 7;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_8 = 8;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_9 = 9;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_10 = 10;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_11 = 11;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_12 = 12;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_13 = 13;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_14 = 14;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_15 = 15;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_16 = 16;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_17 = 17;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_18 = 18;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_19 = 19;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_20 = 20;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_21 = 21;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_22 = 22;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_23 = 23;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_24 = 24;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_25 = 25;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_26 = 26;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_27 = 27;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_28 = 28;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_29 = 29;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_30 = 30;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_31 = 31;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_32 = 32;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_HOME = 33;</code> | ||
+ | | Home or special function button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_PS = GAMEPAD_BUTTON_HOME;</code> | ||
+ | | Playstation button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_XBOX = GAMEPAD_BUTTON_HOME;</code> | ||
+ | | XBox button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_GUIDE = GAMEPAD_BUTTON_HOME;</code> | ||
+ | | Guide button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_LT = 34;</code> | ||
+ | | Left Trigger button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_L2 = GAMEPAD_BUTTON_LT;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_LZ = GAMEPAD_BUTTON_LT;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_RT = 35;</code> | ||
+ | | Right Trigger button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_R2 = GAMEPAD_BUTTON_RT;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_RZ = GAMEPAD_BUTTON_RT;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_LB = 36;</code> | ||
+ | | Left Bumper button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_L1 = GAMEPAD_BUTTON_LB;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_L = GAMEPAD_BUTTON_LB;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_RB = 37;</code> | ||
+ | | Right Bumper button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_R1 = GAMEPAD_BUTTON_RB;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_R = GAMEPAD_BUTTON_RB;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_Y = 38;</code> | ||
+ | | Y button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_TRIANGLE = GAMEPAD_BUTTON_Y;</code> | ||
+ | | Triangle button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_B = 39;</code> | ||
+ | | B button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_CIRCLE = GAMEPAD_BUTTON_B;</code> | ||
+ | | Circle button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_A = 40;</code> | ||
+ | | A button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_CROSS = GAMEPAD_BUTTON_A;</code> | ||
+ | | Cross button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_X = 41;</code> | ||
+ | | X button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_SQUARE = GAMEPAD_BUTTON_X;</code> | ||
+ | | Square button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_SELECT = 42;</code> | ||
+ | | Select button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_BACK = GAMEPAD_BUTTON_SELECT;</code> | ||
+ | | Back button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_SHARE = GAMEPAD_BUTTON_SELECT;</code> | ||
+ | | Share button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_CAPTURE = GAMEPAD_BUTTON_SELECT;</code> | ||
+ | | Capture button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_L3 = 43;</code> | ||
+ | | Left Stick or Left Axis button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_SL = GAMEPAD_BUTTON_L3;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_R3 = 44;</code> | ||
+ | | Right Stick or Right Axis button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_SR = GAMEPAD_BUTTON_R3;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_START = 45;</code> | ||
+ | | Start button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_OPTIONS = GAMEPAD_BUTTON_START;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_UP = 46;</code> | ||
+ | | Up button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_RIGHT = 47;</code> | ||
+ | | Right button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_DOWN = 48;</code> | ||
+ | | Down button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_LEFT = 49;</code> | ||
+ | | Left button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_PLUS = 50;</code> | ||
+ | | Plus button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_MINUS = 51;</code> | ||
+ | | Minus button | ||
+ | |- | ||
+ | | <code>GAMEPAD_BUTTON_TOUCHPAD = 52;</code> | ||
+ | | Touchpad button | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_MAX = 52;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''Joystick and Gamepad Button Names'' | ||
+ | |- | ||
+ | | <code>JOYSTICK_BUTTON_NAMES:array[JOYSTICK_BUTTON_NONE..JOYSTICK_BUTTON_MAX] of String = (</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_NONE',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_1',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_2',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_3',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_4',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_5',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_6',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_7',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_8',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_9',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_10',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_11',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_12',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_13',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_14',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_15',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_16',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_17',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_18',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_19',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_20',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_21',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_22',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_23',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_24',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_25',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_26',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_27',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_28',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_29',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_30',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_31',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'JOYSTICK_BUTTON_32',</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_HOME',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_LT',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_RT',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_LB',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_RB',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_Y',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_B',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_A',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_X',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_SELECT',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_L3',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_R3',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_START',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_UP',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_RIGHT',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_DOWN',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_LEFT',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_PLUS',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_MINUS',</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>'GAMEPAD_BUTTON_TOUCHPAD');</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Joystick logging''' <code> JOYSTICK_LOG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>JOYSTICK_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;</code> | ||
+ | | Joystick debugging messages | ||
+ | |- | ||
+ | | <code>JOYSTICK_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code> | ||
+ | | Joystick informational messages, such as a device being attached or detached. | ||
+ | |- | ||
+ | | <code>JOYSTICK_LOG_LEVEL_WARN = LOG_LEVEL_WARN;</code> | ||
+ | | Joystick warning messages | ||
+ | |- | ||
+ | | <code>JOYSTICK_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code> | ||
+ | | Joystick error messages | ||
+ | |- | ||
+ | | <code>JOYSTICK_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code> | ||
+ | | No Joystick messages | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === |
Revision as of 01:54, 18 November 2022
Return to Unit Reference
Contents
[hide]Description
Ultibo Joystick and Gamepad Interface unit
Gamepads are almost universally used to control game consoles and other gaming platforms as they provide an easy way to interact with many different types of movement in gaming scenarios.
They range from simple devices with a 4 way rocker switch (often known as the D-pad) and a small number of push buttons to elaborate units with multi-axis controls and buttons that cover a whole range of uses.
Joysticks are used for more than just gaming, many modern industrial machines use a joystick as the primary control interface. Even common machines like ride on lawn mowers and earth moving equipment often feature a joystick type of control mechanism.
Devices such as flight simulator yokes will often also appear as a joystick to the system as the available ranges of movement and the reported axes are the same.
Constants
JOYSTICK_*
JOYSTICK_TYPE_*
JOYSTICK_TYPE_*
JOYSTICK_FLAG_*
JOYSTICK_CONTROL_*
JOYSTICK_BUFFER_*
JOYSTICK_MAX_*
JOYSTICK_DEFAULT_*
JOYSTICK_AXIS_*
JOYSTICK_HAT*
JOYSTICK_BUTTON_*
JOYSTICK_LOG_*
Type definitions
Joystick data
Joystick buffer
Joystick extent
Joystick axis
Joystick hat
Joystick properties
Joystick event callback
TJoystickEvent = function(Joystick:PJoystickDevice; Data:PJoystickData):LongWord;
|
Joystick enumeration callback
TJoystickEnumerate = function(Joystick:PJoystickDevice; Data:Pointer):LongWord;
|
Joystick notification callback
TJoystickNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;
|
Joystick device start
TJoystickDeviceStart = function(Joystick:PJoystickDevice):LongWord;
|
Joystick device stop
TJoystickDeviceStop = function(Joystick:PJoystickDevice):LongWord;
|
Joystick device peek
TJoystickDevicePeek = function(Joystick:PJoystickDevice):LongWord;
|
Joystick device read
TJoystickDeviceRead = function(Joystick:PJoystickDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
|
Joystick device write
TJoystickDeviceWrite = function(Joystick:PJoystickDevice; Buffer:Pointer; Size,Count:LongWord):LongWord;
|
Joystick device flush
TJoystickDeviceFlush = function(Joystick:PJoystickDevice):LongWord;
|
Joystick device update
TJoystickDeviceUpdate = function(Joystick:PJoystickDevice):LongWord;
|
Joystick device control
TJoystickDeviceControl = function(Joystick:PJoystickDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
|
Joystick device get properties
TJoystickDeviceGetProperties = function(Joystick:PJoystickDevice; Properties:PJoystickProperties):LongWord;
|
Joystick device
Public variables
Joystick logging
JOYSTICK_DEFAULT_LOG_LEVEL:LongWord = JOYSTICK_LOG_LEVEL_DEBUG;
|
Minimum level for Joystick messages. Only messages with level greater than or equal to this will be printed. |
JOYSTICK_LOG_ENABLED:Boolean;
|
Function declarations
Initialization functions
procedure JoystickInit;
Joystick functions
function JoystickDeviceStart(Joystick:PJoystickDevice):LongWord;
function JoystickDeviceStop(Joystick:PJoystickDevice):LongWord;
function JoystickDevicePeek(Joystick:PJoystickDevice):LongWord;
function JoystickDeviceRead(Joystick:PJoystickDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
function JoystickDeviceWrite(Joystick:PJoystickDevice; Buffer:Pointer; Size,Count:LongWord):LongWord;
function JoystickDeviceFlush(Joystick:PJoystickDevice):LongWord;
function JoystickDeviceUpdate(Joystick:PJoystickDevice):LongWord;
function JoystickDeviceControl(Joystick:PJoystickDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
function JoystickDeviceGetProperties(Joystick:PJoystickDevice; Properties:PJoystickProperties):LongWord;
function JoystickDeviceSetState(Joystick:PJoystickDevice; State:LongWord):LongWord;
function JoystickDeviceCreate:PJoystickDevice;
function JoystickDeviceCreateEx(Size:LongWord):PJoystickDevice;
function JoystickDeviceDestroy(Joystick:PJoystickDevice):LongWord;
function JoystickDeviceRegister(Joystick:PJoystickDevice):LongWord;
function JoystickDeviceDeregister(Joystick:PJoystickDevice):LongWord;
function JoystickDeviceFind(JoystickId:LongWord):PJoystickDevice;
function JoystickDeviceFindByName(const Name:String):PJoystickDevice; inline;
function JoystickDeviceFindByDescription(const Description:String):PJoystickDevice; inline;
function JoystickDeviceEnumerate(Callback:TJoystickEnumerate; Data:Pointer):LongWord;
function JoystickDeviceNotification(Joystick:PJoystickDevice; Callback:TJoystickNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Joystick helper functions
function JoystickGetCount:LongWord; inline;
function JoystickDeviceGetDefault:PJoystickDevice; inline;
function JoystickDeviceSetDefault(Joystick:PJoystickDevice):LongWord;
function JoystickDeviceCheck(Joystick:PJoystickDevice):PJoystickDevice;
function JoystickDeviceAxisToString(Name:LongWord):String;
function JoystickDeviceHatToString(Name:LongWord):String;
function JoystickDeviceButtonToString(Name:LongWord):String;
function JoystickDeviceTypeToString(JoystickType:LongWord):String;
function JoystickDeviceStateToString(JoystickState:LongWord):String;
function JoystickDeviceStateToNotification(State:LongWord):LongWord;
function JoystickDeviceGetAxis(Joystick:PJoystickDevice; Index:LongWord):LongWord;
function JoystickDeviceSetAxis(Joystick:PJoystickDevice; Index,Name:LongWord):LongWord;
function JoystickDeviceGetHat(Joystick:PJoystickDevice; Index:LongWord):LongWord;
function JoystickDeviceSetHat(Joystick:PJoystickDevice; Index,Name:LongWord):LongWord;
function JoystickDeviceGetButton(Joystick:PJoystickDevice; Index:LongWord):LongWord;
function JoystickDeviceSetButton(Joystick:PJoystickDevice; Index,Name:LongWord):LongWord;
function JoystickDeviceSetCallback(Joystick:PJoystickDevice; Event:TJoystickEvent; Parameter:Pointer):LongWord;
function JoystickInsertData(Joystick:PJoystickDevice; Data:PJoystickData; Signal:Boolean):LongWord;
procedure JoystickLog(Level:LongWord; Joystick:PJoystickDevice; const AText:String);
procedure JoystickLogInfo(Joystick:PJoystickDevice; const AText:String);
procedure JoystickLogWarn(Joystick:PJoystickDevice; const AText:String);
procedure JoystickLogError(Joystick:PJoystickDevice; const AText:String);
procedure JoystickLogDebug(Joystick:PJoystickDevice; const AText:String);
Return to Unit Reference