SDL_VirtualJoystickDesc

The structure that describes a virtual joystick.

This structure should be initialized using SDL_INIT_INTERFACE(). All elements of this structure are optional.

Members

Variables

Cleanup
void function(void* userdata) Cleanup;

Cleans up the userdata when the joystick is detached

Rumble
bool function(void* userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) Rumble;

Implements SDL_RumbleJoystick()

RumbleTriggers
bool function(void* userdata, Uint16 left_rumble, Uint16 right_rumble) RumbleTriggers;

Implements SDL_RumbleJoystickTriggers()

SendEffect
bool function(void* userdata, const void* data, int size) SendEffect;

Implements SDL_SendJoystickEffect()

SetLED
bool function(void* userdata, Uint8 red, Uint8 green, Uint8 blue) SetLED;

Implements SDL_SetJoystickLED()

SetPlayerIndex
void function(void* userdata, int player_index) SetPlayerIndex;

Called when the player index is set

SetSensorsEnabled
bool function(void* userdata, bool enabled) SetSensorsEnabled;

Implements SDL_SetGamepadSensorEnabled()

Update
void function(void* userdata) Update;

Called when the joystick state should be updated

axis_mask
Uint32 axis_mask;

A mask of which axes are valid for this controller e.g. (1 << SDL_GAMEPAD_AXIS_LEFTX)

button_mask
Uint32 button_mask;

A mask of which buttons are valid for this controller e.g. (1 << SDL_GAMEPAD_BUTTON_SOUTH)

name
const(char)* name;

The name of the joystick

naxes
Uint16 naxes;

the number of axes on this joystick

nballs
Uint16 nballs;

the number of balls on this joystick

nbuttons
Uint16 nbuttons;

the number of buttons on this joystick

nhats
Uint16 nhats;

the number of hats on this joystick

nsensors
Uint16 nsensors;

the number of sensors on this joystick, requires sensors to point at valid descriptions

ntouchpads
Uint16 ntouchpads;

the number of touchpads on this joystick, requires touchpads to point at valid descriptions

padding
Uint16 padding;

unused

padding2
Uint16[2] padding2;

unused

product_id
Uint16 product_id;

the USB product ID of this joystick

sensors
const(SDL_VirtualJoystickSensorDesc)* sensors;

A pointer to an array of sensor descriptions, required if nsensors is > 0

touchpads
const(SDL_VirtualJoystickTouchpadDesc)* touchpads;

A pointer to an array of touchpad descriptions, required if ntouchpads is > 0

type
Uint16 type;

SDL_JoystickType

userdata
void* userdata;

User data pointer passed to callbacks

vendor_id
Uint16 vendor_id;

the USB vendor ID of this joystick

version_
Uint32 version_;

the version of this interface

See Also

Meta