From bba6555bf18c1c6cc3895b558def0d739f0d3c2e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 4 Aug 2025 10:21:58 -0700 Subject: [PATCH] Enable background input when using Microsoft GameInput --- src/joystick/gdk/SDL_gameinputjoystick.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/joystick/gdk/SDL_gameinputjoystick.cpp b/src/joystick/gdk/SDL_gameinputjoystick.cpp index bd1e9eaf63..e75a5bab30 100644 --- a/src/joystick/gdk/SDL_gameinputjoystick.cpp +++ b/src/joystick/gdk/SDL_gameinputjoystick.cpp @@ -279,6 +279,10 @@ static bool GAMEINPUT_JoystickInit(void) return false; } + // Allow background controller input + // SDL manages focus policy at a higher level, so we can set this unconditionally. + g_pGameInput->SetFocusPolicy(GameInputEnableBackgroundInput | GameInputEnableBackgroundGuideButton | GameInputEnableBackgroundShareButton); + hr = g_pGameInput->RegisterDeviceCallback(NULL, GameInputKindController, GameInputDeviceConnected,