[dinput-3/9] when handling axes,
ignore the ABS_HAT.* as they are handled as POV
Christoph Frick
frick at sc-networks.de
Thu Jul 6 06:13:27 CDT 2006
License: LGPL
ChangeLog:
2006-07-05 Christoph Frick <rid at zefix.tv>
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 */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060706/31e143e8/attachment.pgp
More information about the wine-patches
mailing list