Add SDL_HINT_JOYSTICK_HAPTIC_AXES

Allows users to overwrite the number of haptic axes defined for a given
joystick. Also supports a "wildcard" VID:PID of `0xFFFF/0xFFFF`
This commit is contained in:
Tomasz Pakuła 2025-02-20 19:48:51 +01:00 committed by Sam Lantinga
parent db817a37f4
commit 58388e8db4
2 changed files with 113 additions and 0 deletions

View file

@ -2191,6 +2191,28 @@ extern "C" {
*/
#define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES "SDL_JOYSTICK_ZERO_CENTERED_DEVICES"
/**
* A variable containing a list of devices and their desired number of haptic
* (force feedback) enabled axis.
*
* The format of the string is a comma separated list of USB VID/PID pairs in
* hexadecimal form plus the number of desired axes, e.g.
*
* `0xAAAA/0xBBBB/1,0xCCCC/0xDDDD/3`
*
* This hint supports a "wildcard" device that will set the number of haptic
* axes on all initialized haptic devices which were not defined explicitly
* in this hint.
*
* `0xFFFF/0xFFFF/1`
*
* This hint should be set before a controller is opened. The number of
* haptic axes won't exceed the number of real axes found on the device.
*
* \since This hint is available since SDL 3.2.5.
*/
#define SDL_HINT_JOYSTICK_HAPTIC_AXES "SDL_JOYSTICK_HAPTIC_AXES"
/**
* A variable that controls keycode representation in keyboard events.
*