Skip to content

Commit

Permalink
DirectInput: ignore everything but joysticks and gamepads (thanks, Ju…
Browse files Browse the repository at this point in the history
…stin!).

Fixes Bugzilla #2460.
  • Loading branch information
icculus committed Apr 8, 2015
1 parent 6e53bc9 commit 785618a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/joystick/windows/SDL_dinputjoystick.c
Expand Up @@ -345,6 +345,11 @@ EnumJoysticksCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext)
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;
while (pNewJoystick) {
if (!SDL_memcmp(&pNewJoystick->dxdevice.guidInstance, &pdidInstance->guidInstance, sizeof(pNewJoystick->dxdevice.guidInstance))) {
Expand Down

0 comments on commit 785618a

Please sign in to comment.