SDL 2.0
SDL_VirtualJoystickDesc Struct Reference

#include <SDL_joystick.h>

Data Fields

Uint16 version
 
Uint16 type
 
Uint16 naxes
 
Uint16 nbuttons
 
Uint16 nhats
 
Uint16 vendor_id
 
Uint16 product_id
 
Uint16 padding
 
Uint32 button_mask
 
Uint32 axis_mask
 
const char * name
 
void * userdata
 
void(* Update )(void *userdata)
 
void(* SetPlayerIndex )(void *userdata, int player_index)
 
int(* Rumble )(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)
 
int(* RumbleTriggers )(void *userdata, Uint16 left_rumble, Uint16 right_rumble)
 
int(* SetLED )(void *userdata, Uint8 red, Uint8 green, Uint8 blue)
 
int(* SendEffect )(void *userdata, const void *data, int size)
 

Detailed Description

The structure that defines an extended virtual joystick description

The caller must zero the structure and then initialize the version with SDL_VIRTUAL_JOYSTICK_DESC_VERSION before passing it to SDL_JoystickAttachVirtualEx() All other elements of this structure are optional and can be left 0.

See also
SDL_JoystickAttachVirtualEx

Definition at line 378 of file SDL_joystick.h.

Field Documentation

◆ axis_mask

Uint32 SDL_VirtualJoystickDesc::axis_mask

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

Definition at line 390 of file SDL_joystick.h.

◆ button_mask

Uint32 SDL_VirtualJoystickDesc::button_mask

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

Definition at line 388 of file SDL_joystick.h.

◆ name

const char* SDL_VirtualJoystickDesc::name

the name of the joystick

Definition at line 392 of file SDL_joystick.h.

◆ naxes

Uint16 SDL_VirtualJoystickDesc::naxes

the number of axes on this joystick

Definition at line 382 of file SDL_joystick.h.

◆ nbuttons

Uint16 SDL_VirtualJoystickDesc::nbuttons

the number of buttons on this joystick

Definition at line 383 of file SDL_joystick.h.

◆ nhats

Uint16 SDL_VirtualJoystickDesc::nhats

the number of hats on this joystick

Definition at line 384 of file SDL_joystick.h.

◆ padding

Uint16 SDL_VirtualJoystickDesc::padding

unused

Definition at line 387 of file SDL_joystick.h.

◆ product_id

Uint16 SDL_VirtualJoystickDesc::product_id

the USB product ID of this joystick

Definition at line 386 of file SDL_joystick.h.

◆ Rumble

int(* SDL_VirtualJoystickDesc::Rumble) (void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)

Implements SDL_JoystickRumble()

Definition at line 397 of file SDL_joystick.h.

◆ RumbleTriggers

int(* SDL_VirtualJoystickDesc::RumbleTriggers) (void *userdata, Uint16 left_rumble, Uint16 right_rumble)

Implements SDL_JoystickRumbleTriggers()

Definition at line 398 of file SDL_joystick.h.

◆ SendEffect

int(* SDL_VirtualJoystickDesc::SendEffect) (void *userdata, const void *data, int size)

Implements SDL_JoystickSendEffect()

Definition at line 400 of file SDL_joystick.h.

◆ SetLED

int(* SDL_VirtualJoystickDesc::SetLED) (void *userdata, Uint8 red, Uint8 green, Uint8 blue)

Implements SDL_JoystickSetLED()

Definition at line 399 of file SDL_joystick.h.

◆ SetPlayerIndex

void(* SDL_VirtualJoystickDesc::SetPlayerIndex) (void *userdata, int player_index)

Called when the player index is set

Definition at line 396 of file SDL_joystick.h.

◆ type

Uint16 SDL_VirtualJoystickDesc::type

SDL_JoystickType

Definition at line 381 of file SDL_joystick.h.

◆ Update

void(* SDL_VirtualJoystickDesc::Update) (void *userdata)

Called when the joystick state should be updated

Definition at line 395 of file SDL_joystick.h.

◆ userdata

void* SDL_VirtualJoystickDesc::userdata

User data pointer passed to callbacks

Definition at line 394 of file SDL_joystick.h.

◆ vendor_id

Uint16 SDL_VirtualJoystickDesc::vendor_id

the USB vendor ID of this joystick

Definition at line 385 of file SDL_joystick.h.

◆ version

Uint16 SDL_VirtualJoystickDesc::version

SDL_VIRTUAL_JOYSTICK_DESC_VERSION

Definition at line 380 of file SDL_joystick.h.


The documentation for this struct was generated from the following file: