Added the gamepad hint SDL_GAMECONTROLLER_USE_GAMECUBE_LABELS

This is for internal use to signal that a mapping uses positional GameCube buttons. It's set so we know whether a mapping uses the older style labeled buttons or the newer style positional buttons. If a positional mapping is used with SDL2, then it will be ignored, since the hint is marked as defaulting true and the mapping conditional is that the hint is false.
This commit is contained in:
Sam Lantinga 2025-05-01 10:35:49 -07:00
parent 21a7bbbf14
commit 48dfc03a87
4 changed files with 132 additions and 70 deletions

View file

@ -828,8 +828,6 @@ bool SDL_InitJoysticks(void)
SDL_joysticks_initialized = true;
SDL_InitGamepadMappings();
SDL_LoadVIDPIDList(&old_xboxone_controllers);
SDL_LoadVIDPIDList(&arcadestick_devices);
SDL_LoadVIDPIDList(&blacklist_devices);
@ -840,6 +838,8 @@ bool SDL_InitJoysticks(void)
SDL_LoadVIDPIDList(&wheel_devices);
SDL_LoadVIDPIDList(&zero_centered_devices);
SDL_InitGamepadMappings();
// See if we should allow joystick events while in the background
SDL_AddHintCallback(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS,
SDL_JoystickAllowBackgroundEventsChanged, NULL);