Fixed bug 4854 - Add a way to extend the values in controller_type.h

Added a hint SDL_HINT_GAMECONTROLLERTYPE to allow overriding the built-in controller type database
This commit is contained in:
Sam Lantinga 2020-03-02 10:37:28 -08:00
parent 27f346a058
commit 4572dd2ae6
2 changed files with 73 additions and 0 deletions

View file

@ -468,6 +468,24 @@ extern "C" {
*/
#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
/**
* \brief A variable that overrides the automatic controller type detection
*
* The variable should be comma separated entries, in the form: VID/PID=type
*
* The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd
*
* The type should be one of:
* Xbox360
* XboxOne
* PS3
* PS4
* SwitchPro
*
* This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
*/
#define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE"
/**
* \brief A variable that lets you manually hint extra gamecontroller db entries.
*