Fixed bug 3005 - MOMO steering wheel not detected by SDL
authorSam Lantinga <slouken@libsdl.org>
Thu, 11 Jun 2015 12:04:57 -0700
changeset 9728161fee58e36f
parent 9727 b845f659e015
child 9729 64f0929bcd2e
Fixed bug 3005 - MOMO steering wheel not detected by SDL

Joe Thompson

This is a regression. The changes to fix #2460 cause the EnumJoysticksCallback() function to return without adding devices (Line 345 in SDL-45a632fd9d83\src\joystick\windows\SDL_dinputjoystick.c).
Looking at dinput.h on my system, at least DI8DEVTYPE_DRIVING and DI8DEVTYPE_FLIGHT need to be added to the test.
It might be better to check if (devtype == DI8DEVTYPE_SUPPLEMENTAL) rather than checking if it is NOT EQUAL to a long list of types. Or check if the device is already in the list.
src/joystick/windows/SDL_dinputjoystick.c
     1.1 --- a/src/joystick/windows/SDL_dinputjoystick.c	Tue Jun 09 21:08:24 2015 -0300
     1.2 +++ b/src/joystick/windows/SDL_dinputjoystick.c	Thu Jun 11 12:04:57 2015 -0700
     1.3 @@ -342,7 +342,7 @@
     1.4      JoyStick_DeviceData *pPrevJoystick = NULL;
     1.5      const DWORD devtype = (pdidInstance->dwDevType & 0xFF);
     1.6  
     1.7 -    if ((devtype != DI8DEVTYPE_JOYSTICK) && (devtype != DI8DEVTYPE_GAMEPAD) && (devtype != DI8DEVTYPE_1STPERSON)) {
     1.8 +    if (devtype == DI8DEVTYPE_SUPPLEMENTAL) {
     1.9          return DIENUM_CONTINUE;  /* Ignore touchpads, etc. */
    1.10      }
    1.11