From f29de0d324adb047b624028be0b06c7d57da2993 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 11 Jun 2015 12:04:57 -0700 Subject: [PATCH] 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-0a2b6bc7005f\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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c index e30e010da..61d5b3862 100644 --- a/src/joystick/windows/SDL_dinputjoystick.c +++ b/src/joystick/windows/SDL_dinputjoystick.c @@ -342,7 +342,7 @@ EnumJoysticksCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext) JoyStick_DeviceData *pPrevJoystick = NULL; const DWORD devtype = (pdidInstance->dwDevType & 0xFF); - if ((devtype != DI8DEVTYPE_JOYSTICK) && (devtype != DI8DEVTYPE_GAMEPAD) && (devtype != DI8DEVTYPE_1STPERSON)) { + if (devtype == DI8DEVTYPE_SUPPLEMENTAL) { return DIENUM_CONTINUE; /* Ignore touchpads, etc. */ }