Added the ability to specify which buttons and axes are present for virtual controllers

This commit is contained in:
Sam Lantinga 2022-05-15 20:33:28 -07:00
parent 49ca8bf520
commit bfac54b59c
2 changed files with 116 additions and 80 deletions

View file

@ -365,6 +365,10 @@ typedef struct SDL_VirtualJoystickDesc
Uint16 vendor_id; /**< the USB vendor ID of this joystick */
Uint16 product_id; /**< the USB product ID of this joystick */
Uint16 padding; /**< unused */
Uint32 button_mask; /**< A mask of which buttons are valid for this controller
e.g. (1 << SDL_CONTROLLER_BUTTON_A) */
Uint32 axis_mask; /**< A mask of which axes are valid for this controller
e.g. (1 << SDL_CONTROLLER_AXIS_LEFTX) */
const char *name; /**< the name of the joystick */
void *userdata; /**< User data pointer passed to callbacks */