mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-06 18:06:26 +00:00
Don't use raw input while Remote Desktop is active
Raw input will not send game controller events while Remote Desktop is active, so dynamically switch between XInput and raw input when Remote Desktop state changes. Fixes https://github.com/libsdl-org/SDL/issues/7759
This commit is contained in:
@@ -66,13 +66,6 @@ int SDL_XINPUT_JoystickInit(void)
|
||||
{
|
||||
s_bXInputEnabled = SDL_GetHintBoolean(SDL_HINT_XINPUT_ENABLED, SDL_TRUE);
|
||||
|
||||
#ifdef SDL_JOYSTICK_RAWINPUT
|
||||
if (RAWINPUT_IsEnabled()) {
|
||||
/* The raw input driver handles more than 4 controllers, so prefer that when available */
|
||||
s_bXInputEnabled = SDL_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (s_bXInputEnabled && WIN_LoadXInputDLL() < 0) {
|
||||
s_bXInputEnabled = SDL_FALSE; /* oh well. */
|
||||
}
|
||||
@@ -327,6 +320,13 @@ void SDL_XINPUT_JoystickDetect(JoyStick_DeviceData **pContext)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef SDL_JOYSTICK_RAWINPUT
|
||||
if (RAWINPUT_IsEnabled()) {
|
||||
/* The raw input driver handles more than 4 controllers, so prefer that when available */
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* iterate in reverse, so these are in the final list in ascending numeric order. */
|
||||
for (iuserid = XUSER_MAX_COUNT - 1; iuserid >= 0; iuserid--) {
|
||||
const Uint8 userid = (Uint8)iuserid;
|
||||
|
Reference in New Issue
Block a user