From c56c40fad136cdcad6199c59f16aa1ddbc2becaa Mon Sep 17 00:00:00 2001 From: Shenjoku Date: Wed, 12 Jun 2013 10:30:37 -0700 Subject: [PATCH] Added another missing case when enumerating joysticks, DI8DEVTYPE_SUPPLEMENTAL, that should fix a lot more pads that were being reported as not being detected. Also added some debug log messages that output each device's type and name so in the future if other devices fail to be detected we can easily see what it is in the info log. --- src/arch/InputHandler/InputHandler_DirectInput.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/arch/InputHandler/InputHandler_DirectInput.cpp b/src/arch/InputHandler/InputHandler_DirectInput.cpp index f5104b648d..b8d7c765a0 100644 --- a/src/arch/InputHandler/InputHandler_DirectInput.cpp +++ b/src/arch/InputHandler/InputHandler_DirectInput.cpp @@ -25,10 +25,13 @@ static BOOL CALLBACK EnumDevicesCallback( const DIDEVICEINSTANCE *pdidInstance, { DIDevice device; + LOG->Info( "DInput: Enumerating device - Type: 0x%08X Instance Name: \"%s\" Product Name: \"%s\"", pdidInstance->dwDevType, pdidInstance->tszInstanceName, pdidInstance->tszProductName ); + switch( GET_DIDEVICE_TYPE(pdidInstance->dwDevType) ) { case DI8DEVTYPE_JOYSTICK: case DI8DEVTYPE_GAMEPAD: + case DI8DEVTYPE_SUPPLEMENTAL: { device.type = device.JOYSTICK; break; @@ -36,7 +39,7 @@ static BOOL CALLBACK EnumDevicesCallback( const DIDEVICEINSTANCE *pdidInstance, case DI8DEVTYPE_KEYBOARD: device.type = device.KEYBOARD; break; case DI8DEVTYPE_MOUSE: device.type = device.MOUSE; break; - default: return DIENUM_CONTINUE; + default: LOG->Info( "DInput: Unrecognized device ignored." ); return DIENUM_CONTINUE; } device.JoystickInst = *pdidInstance;