diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 7a1eabff5f..fffc010411 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -2126,9 +2126,16 @@ SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid) SDL_GetJoystickGUIDInfo(guid, &vendor, &product, &version, NULL); +#ifdef __WIN32__ + if (SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", SDL_FALSE)) { + /* We're running under Steam and it will hide any controllers that we shouldn't open */ + return FALSE; + } +#else if (SDL_IsJoystickSteamVirtualGamepad(vendor, product, version)) { return !SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", SDL_FALSE); } +#endif if (SDL_allowed_controllers.num_included_entries > 0) { if (SDL_VIDPIDInList(vendor, product, &SDL_allowed_controllers)) {