mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-14 13:56:00 +00:00
Improved reliability of gamepad message ordering
The gamepad vs joystick events always happen in this order: SDL_EVENT_JOYSTICK_ADDED SDL_EVENT_GAMEPAD_ADDED SDL_EVENT_GAMEPAD_REMAPPED SDL_EVENT_GAMEPAD_REMOVED SDL_EVENT_JOYSTICK_REMOVED Whenever a mapping is changed, any controller affected by that mapping will generate a gamepad event. You will only get one SDL_EVENT_GAMEPAD_REMAPPED event per controller per batch of mapping changes, where SDL_AddGamepadMappingsFromFile() and SDL_AddGamepadMapping() are each a batch of changes.
This commit is contained in:
@@ -32,6 +32,8 @@ extern void SDL_QuitGamepadMappings(void);
|
||||
extern int SDL_InitGamepads(void);
|
||||
extern void SDL_QuitGamepads(void);
|
||||
|
||||
extern void SDL_PrivateGamepadAdded(SDL_JoystickID instance_id);
|
||||
extern void SDL_PrivateGamepadRemoved(SDL_JoystickID instance_id);
|
||||
|
||||
/* Function to return whether a joystick name and GUID is a gamepad */
|
||||
extern SDL_bool SDL_IsGamepadNameAndGUID(const char *name, SDL_JoystickGUID guid);
|
||||
|
Reference in New Issue
Block a user