DirectInput: ignore everything but joysticks and gamepads (thanks, Justin!).
Fixes Bugzilla #2460. --HG-- extra : rebase_source : db50b42eeefe76084e477dc521fcd8f86fe9d1b0
This commit is contained in:
parent
e7b13cff94
commit
67034e77b6
1 changed files with 5 additions and 0 deletions
|
@ -345,6 +345,11 @@ EnumJoysticksCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext)
|
||||||
return DIENUM_CONTINUE; /* ignore XInput devices here, keep going. */
|
return DIENUM_CONTINUE; /* ignore XInput devices here, keep going. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const DWORD devtype = (pdidInstance->dwDevType & 0xFF);
|
||||||
|
if ((devtype != DI8DEVTYPE_JOYSTICK) && (devtype != DI8DEVTYPE_GAMEPAD)) {
|
||||||
|
return DIENUM_CONTINUE; /* Ignore touchpads, etc. */
|
||||||
|
}
|
||||||
|
|
||||||
pNewJoystick = *(JoyStick_DeviceData **)pContext;
|
pNewJoystick = *(JoyStick_DeviceData **)pContext;
|
||||||
while (pNewJoystick) {
|
while (pNewJoystick) {
|
||||||
if (!SDL_memcmp(&pNewJoystick->dxdevice.guidInstance, &pdidInstance->guidInstance, sizeof(pNewJoystick->dxdevice.guidInstance))) {
|
if (!SDL_memcmp(&pNewJoystick->dxdevice.guidInstance, &pdidInstance->guidInstance, sizeof(pNewJoystick->dxdevice.guidInstance))) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue