Skip to content

Commit

Permalink
Don't filter out controllers when launched by Steam under Proton
Browse files Browse the repository at this point in the history
Fixes #11579
  • Loading branch information
slouken committed Dec 6, 2024
1 parent 2e5208f commit 3060105
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/joystick/SDL_gamepad.c
Original file line number Diff line number Diff line change
Expand Up @@ -2620,6 +2620,17 @@ bool SDL_ShouldIgnoreGamepad(Uint16 vendor_id, Uint16 product_id, Uint16 version
return true;
}

#ifdef SDL_PLATFORM_WIN32
if (SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", false) &&
SDL_GetHintBoolean("STEAM_COMPAT_PROTON", false)) {
// We are launched by Steam and running under Proton
// We can't tell whether this controller is a Steam Virtual Gamepad,
// so assume that Proton is doing the appropriate filtering of controllers
// and anything we see here is fine to use.
return false;
}
#endif // SDL_PLATFORM_WIN32

if (SDL_IsJoystickSteamVirtualGamepad(vendor_id, product_id, version)) {
return !SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", false);
}
Expand Down

0 comments on commit 3060105

Please sign in to comment.