Răsfoiți Sursa

Enable background input when using Microsoft GameInput

Sam Lantinga 1 lună în urmă
părinte
comite
bba6555bf1
1 a modificat fișierele cu 4 adăugiri și 0 ștergeri
  1. 4 0
      src/joystick/gdk/SDL_gameinputjoystick.cpp

+ 4 - 0
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,