We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16b2de2 commit 1ffc307Copy full SHA for 1ffc307
src/joystick/SDL_gamecontroller.c
@@ -2065,7 +2065,12 @@ SDL_bool SDL_IsGameController(int joystick_index)
2065
2066
SDL_LockJoysticks();
2067
{
2068
- if (SDL_PrivateGetControllerMapping(joystick_index) != NULL) {
+ SDL_JoystickType joystick_type = SDL_JoystickGetDeviceType(joystick_index);
2069
+ /* do not spawn mappings on known hidapi joystick devices */
2070
+ if (joystick_type != SDL_JOYSTICK_TYPE_GAMECONTROLLER &&
2071
+ joystick_type != SDL_JOYSTICK_TYPE_UNKNOWN) {
2072
+ retval = SDL_FALSE;
2073
+ } else if (SDL_PrivateGetControllerMapping(joystick_index) != NULL) {
2074
retval = SDL_TRUE;
2075
} else {
2076
retval = SDL_FALSE;
0 commit comments