Unit Joystick

From Ultibo.org
Revision as of 05:38, 17 November 2022 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


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


To be documented

Type definitions



Joystick data

[Expand]

PJoystickData = ^TJoystickData;

TJoystickData = record

Joystick buffer

[Expand]

PJoystickBuffer = ^TJoystickBuffer;

TJoystickBuffer = record

Joystick extent

[Expand]

PJoystickExtent = ^TJoystickExtent;

TJoystickExtent = record

Joystick axis

[Expand]

PJoystickAxis = ^TJoystickAxis;

TJoystickAxis = record

Joystick hat

[Expand]

PJoystickHat = ^TJoystickHat;

TJoystickHat = record

Joystick properties

[Expand]

PJoystickProperties = ^TJoystickProperties;

TJoystickProperties = record

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

[Expand]

PJoystickDevice = ^TJoystickDevice;

TJoystickDevice = record


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


To be documented


Return to Unit Reference