Aric Stewart : dinput: OS/X joystick add POV controls.
Alexandre Julliard
julliard at winehq.org
Wed Mar 11 10:04:36 CDT 2009
Module: wine
Branch: master
Commit: 87d61ab21bfde7d63aa1c1bc3925e1d2f6673129
URL: http://source.winehq.org/git/wine.git/?a=commit;h=87d61ab21bfde7d63aa1c1bc3925e1d2f6673129
Author: Aric Stewart <aric at codeweavers.com>
Date: Tue Mar 10 14:59:35 2009 -0500
dinput: OS/X joystick add POV controls.
---
dlls/dinput/joystick_osx.c | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c
index 9dafcb5..fb59ec5 100644
--- a/dlls/dinput/joystick_osx.c
+++ b/dlls/dinput/joystick_osx.c
@@ -332,6 +332,22 @@ static void get_osx_device_elements(JoystickImpl *device)
axes++;
break;
}
+ case kIOHIDElementTypeInput_Misc:
+ {
+ uint32_t usage = IOHIDElementGetUsage( tIOHIDElementRef );
+ switch(usage)
+ {
+ case kHIDUsage_GD_Hatswitch:
+ {
+ CFArrayInsertValueAtIndex(device->elementCFArrayRef, (axes+povs), tIOHIDElementRef);
+ povs++;
+ break;
+ }
+ default:
+ FIXME("Unhandled usage %i\n",usage);
+ }
+ break;
+ }
default:
FIXME("Unhandled type %i\n",eleType);
}
@@ -384,6 +400,7 @@ static void poll_osx_device_state(JoystickGenericImpl *device_in)
if (gElementCFArrayRef)
{
int button_idx = 0;
+ int pov_idx = 0;
CFIndex idx, cnt = CFArrayGetCount( gElementCFArrayRef );
for ( idx = 0; idx < cnt; idx++ )
@@ -404,6 +421,27 @@ static void poll_osx_device_state(JoystickGenericImpl *device_in)
button_idx ++;
}
break;
+ case kIOHIDElementTypeInput_Misc:
+ {
+ uint32_t usage = IOHIDElementGetUsage( tIOHIDElementRef );
+ switch(usage)
+ {
+ case kHIDUsage_GD_Hatswitch:
+ {
+ IOHIDDeviceGetValue(tIOHIDDeviceRef, tIOHIDElementRef, &valueRef);
+ val = IOHIDValueGetIntegerValue(valueRef);
+ if (val >= 8)
+ device->generic.js.rgdwPOV[pov_idx] = -1;
+ else
+ device->generic.js.rgdwPOV[pov_idx] = val * 4500;
+ pov_idx ++;
+ break;
+ }
+ default:
+ FIXME("unhandled usage %i\n",usage);
+ }
+ break;
+ }
default:
FIXME("Unhandled type %i\n",eleType);
}
More information about the wine-cvs
mailing list