Module: wine Branch: refs/heads/master Commit: 03260f738b03ac2152af3f8f0f6c73b7733db949 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=03260f738b03ac2152af3f8f...
Author: Christoph Frick frick@sc-networks.de Date: Thu Jul 6 13:13:27 2006 +0200
dinput: When handling axes, ignore the ABS_HAT.* as they are handled as POV.
---
dlls/dinput/joystick_linuxinput.c | 23 +++++++++++++++++++++-- 1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index e89a4b7..669a474 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -994,7 +994,19 @@ static HRESULT WINAPI JoystickAImpl_GetC lpDIDevCaps->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
axes=0; - for (i=0;i<ABS_MAX;i++) if (test_bit(This->joydev->absbits,i)) axes++; + for (i=0;i<ABS_MAX;i++) { + if (!test_bit(This->joydev->absbits,i)) continue; + switch (i) { + case ABS_HAT0X: case ABS_HAT0Y: + case ABS_HAT1X: case ABS_HAT1Y: + case ABS_HAT2X: case ABS_HAT2Y: + case ABS_HAT3X: case ABS_HAT3Y: + /* will be handled as POV - see below */ + break; + default: + axes++; + } + } buttons=0; for (i=0;i<KEY_MAX;i++) if (test_bit(This->joydev->keybits,i)) buttons++; povs=0; @@ -1090,8 +1102,15 @@ static HRESULT WINAPI JoystickAImpl_Enum ddoi.guidType = GUID_Slider; ddoi.dwOfs = DIJOFS_SLIDER(1); break; + case ABS_HAT0X: case ABS_HAT0Y: + case ABS_HAT1X: case ABS_HAT1Y: + case ABS_HAT2X: case ABS_HAT2Y: + case ABS_HAT3X: case ABS_HAT3Y: + /* will be handled as POV - see below */ + continue; default: - FIXME("unhandled abs axis %d, ignoring!\n",i); + FIXME("unhandled abs axis 0x%02x, ignoring!\n",i); + continue; } ddoi.dwType = DIDFT_MAKEINSTANCE(i << WINE_JOYSTICK_AXIS_BASE) | DIDFT_ABSAXIS; /* Linux event force feedback supports only (and always) x and y axes */