Disable the RAWINPUT joystick driver by default

It's only needed to support more than 4 Xbox controllers, and adds significant complexity to the joystick processing, and we regularly get bugs from people who aren't using an SDL window who need to turn on SDL_HINT_JOYSTICK_THREAD.
This commit is contained in:
Sam Lantinga 2022-10-17 07:39:52 -07:00
parent 5025f24033
commit 47ba997f06
3 changed files with 8 additions and 3 deletions

View File

@ -10,6 +10,9 @@ General:
* Added support for Nintendo Wii controllers to the HIDAPI driver, and a hint SDL_HINT_JOYSTICK_HIDAPI_WII to control whether this is used * Added support for Nintendo Wii controllers to the HIDAPI driver, and a hint SDL_HINT_JOYSTICK_HIDAPI_WII to control whether this is used
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED to control whether the player LED should be lit on the Nintendo Wii controllers * Added the hint SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED to control whether the player LED should be lit on the Nintendo Wii controllers
Windows:
* The RAWINPUT joystick driver is disabled by default, since it's only needed to support more than 4 Xbox controllers, and adds significant complexity to the joystick processing.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
2.24.0: 2.24.0:

View File

@ -938,9 +938,11 @@ extern "C" {
/** /**
* \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices. * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices.
* *
* Enabling this hint allows for more than 4 Xbox controllers on Windows, but adds significant complexity to the joystick processing. If you enable this hint and do not use an SDL window in your application, you may need to set the hint SDL_HINT_JOYSTICK_THREAD to "1" to handle joystick input messages.
*
* This variable can be set to the following values: * This variable can be set to the following values:
* "0" - RAWINPUT drivers are not used * "0" - RAWINPUT drivers are not used (the default)
* "1" - RAWINPUT drivers are used (the default) * "1" - RAWINPUT drivers are used
*/ */
#define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT" #define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT"

View File

@ -860,7 +860,7 @@ RAWINPUT_JoystickInit(void)
return -1; return -1;
} }
if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_RAWINPUT, SDL_TRUE)) { if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_RAWINPUT, SDL_FALSE)) {
return -1; return -1;
} }