TSdlVirtualJoystickDesc
A virtual joystick.
This record should be initialized using Init. All members of this record are optional.
Definition
Unit: Neslib.Sdl3.Input
See Also
- TSdlVirtualJoystickDesc.Attach
- TSdlVirtualJoystickDesc.Init
- TSdlVirtualJoystickSensorDesc
- TSdlVirtualJoystickTouchpadDesc
Properties
Name | Description |
---|---|
Cleanup | Cleans up the userdata when the joystick is detached |
Kind | The joystick type |
Name | The name of the joystick |
NumAxes | The number of axes on this joystick |
NumBalls | The number of balls on this joystick |
NumButtons | The number of buttons on this joystick |
NumHats | The number of hats on this joystick |
ProductID | The USB product ID of this joystick |
Rumble | Implements TSdlJoystick.Rumble |
RumbleTriggers | Implements TSdlJoystick.RumbleTriggers |
SendEffect | Implements TSdlJoystick.SendJEffect |
Sensors | An array of sensor descriptions |
SetLed | Implements TSdlJoystick.SetLed |
SetPlayerIndex | Called when the player index is set |
SetSensorsEnabled | Implements TSdlGamepad.SetSensorEnabled |
Touchpads | An array of touchpad descriptions |
Update | Called when the joystick state should be updated |
UserData | User data pointer passed to callbacks |
ValidAxes | A set of axes that are valid for this controller |
ValidButtons | Set of buttons that are valid for this controller |
VendorID | The USB vendor ID of this joystick |
Methods
Name | Description |
---|---|
Attach | Attach a new virtual joystick. |
Detach | Detach a virtual joystick. |
Init | Initializes this record. You must call this method before attaching it. |
Property Descriptions
Cleanup
Cleans up the userdata when the joystick is detached
property Cleanup: TSdlVirtualJoystickCleanup read GetCleanup write SetCleanup
Type: TSdlVirtualJoystickCleanup
Kind
The joystick type
property Kind: TSdlJoystickKind read GetKind write SetKind
Type: TSdlJoystickKind
Name
The name of the joystick
property Name: String read FName write SetName
Type: String
NumAxes
The number of axes on this joystick
property NumAxes: Smallint read FHandle.naxes write FHandle.naxes
Type: Smallint
NumBalls
The number of balls on this joystick
property NumBalls: Smallint read FHandle.nballs write FHandle.nballs
Type: Smallint
NumButtons
The number of buttons on this joystick
property NumButtons: Smallint read FHandle.nbuttons write FHandle.nbuttons
Type: Smallint
NumHats
The number of hats on this joystick
property NumHats: Smallint read FHandle.nhats write FHandle.nhats
Type: Smallint
ProductID
The USB product ID of this joystick
property ProductID: Word read FHandle.product_id write FHandle.product_id
Type: Word
Rumble
Implements TSdlJoystick.Rumble
property Rumble: TSdlVirtualJoystickRumble read GetRumble write SetRumble
Type: TSdlVirtualJoystickRumble
RumbleTriggers
Implements TSdlJoystick.RumbleTriggers
property RumbleTriggers: TSdlVirtualJoystickRumbleTriggers read GetRumbleTriggers write SetRumbleTriggers
Type: TSdlVirtualJoystickRumbleTriggers
SendEffect
Implements TSdlJoystick.SendJEffect
property SendEffect: TSdlVirtualJoystickSendEffect read GetSendEffect write SetSendEffect
Type: TSdlVirtualJoystickSendEffect
Sensors
An array of sensor descriptions
property Sensors: TArray<TSdlVirtualJoystickSensorDesc> read FSensors write SetSensors
Type: TArray<TSdlVirtualJoystickSensorDesc>
SetLed
Implements TSdlJoystick.SetLed
property SetLed: TSdlVirtualJoystickSetLed read GetSetLed write SetSetLed
Type: TSdlVirtualJoystickSetLed
SetPlayerIndex
Called when the player index is set
property SetPlayerIndex: TSdlVirtualJoystickSetPlayerIndex read GetSetPlayerIndex write SetSetPlayerIndex
Type: TSdlVirtualJoystickSetPlayerIndex
SetSensorsEnabled
Implements TSdlGamepad.SetSensorEnabled
property SetSensorsEnabled: TSdlVirtualJoystickSetSensorsEnabled read GetSetSensorsEnabled write SetSetSensorsEnabled
Type: TSdlVirtualJoystickSetSensorsEnabled
Touchpads
An array of touchpad descriptions
property Touchpads: TArray<TSdlVirtualJoystickTouchpadDesc> read FTouchpads write SetTouchpads
Type: TArray<TSdlVirtualJoystickTouchpadDesc>
Update
Called when the joystick state should be updated
property Update: TSdlVirtualJoystickUpdate read GetUpdate write SetUpdate
Type: TSdlVirtualJoystickUpdate
UserData
User data pointer passed to callbacks
property UserData: Pointer read FHandle.userdata write FHandle.userdata
Type: Pointer
ValidAxes
A set of axes that are valid for this controller
property ValidAxes: TSdlGamepadAxes read GetValidAxes write SetValidAxes
Type: TSdlGamepadAxes
ValidButtons
Set of buttons that are valid for this controller
property ValidButtons: TSdlGamepadButtons read GetValidButtons write SetValidButtons
Type: TSdlGamepadButtons
VendorID
The USB vendor ID of this joystick
property VendorID: Word read FHandle.vendor_id write FHandle.vendor_id
Type: Word
Method Descriptions
Attach
Attach a new virtual joystick.
function Attach: TSdlJoystickID; inline
Exceptions
ESdlError
: Raised on failure.
Returns
TSdlJoystickID
: The joystick instance ID.
See Also
Detach(TSdlJoystickID)
Detach a virtual joystick.
class procedure Detach(const AInstanceID: TSdlJoystickID); inline; static
Exceptions
ESdlError
: Raised on failure.
Parameters
AInstanceID
: TSdlJoystickID
: The joystick instance ID, previously returned Attach.
See Also
Init
Initializes this record. You must call this method before attaching it.
procedure Init; inline