dinput: OS/X joystick add GD_X, GD_Y, GD_Z axes.

This commit is contained in:
Aric Stewart 2009-03-10 14:59:41 -05:00 committed by Alexandre Julliard
parent 87d61ab21b
commit ffbd6a79a4
1 changed files with 28 additions and 0 deletions

View File

@ -343,6 +343,14 @@ static void get_osx_device_elements(JoystickImpl *device)
povs++;
break;
}
case kHIDUsage_GD_X:
case kHIDUsage_GD_Y:
case kHIDUsage_GD_Z:
{
CFArrayInsertValueAtIndex(device->elementCFArrayRef, axes, tIOHIDElementRef);
axes++;
break;
}
default:
FIXME("Unhandled usage %i\n",usage);
}
@ -437,6 +445,26 @@ static void poll_osx_device_state(JoystickGenericImpl *device_in)
pov_idx ++;
break;
}
case kHIDUsage_GD_X:
case kHIDUsage_GD_Y:
case kHIDUsage_GD_Z:
{
IOHIDDeviceGetValue(tIOHIDDeviceRef, tIOHIDElementRef, &valueRef);
val = IOHIDValueGetIntegerValue(valueRef);
switch (usage)
{
case kHIDUsage_GD_X:
device->generic.js.lX = joystick_map_axis(&device->generic.props[idx], val);
break;
case kHIDUsage_GD_Y:
device->generic.js.lY = joystick_map_axis(&device->generic.props[idx], val);
break;
case kHIDUsage_GD_Z:
device->generic.js.lZ = joystick_map_axis(&device->generic.props[idx], val);
break;
}
break;
}
default:
FIXME("unhandled usage %i\n",usage);
}