Commit 6bbec8e6 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

dinput: OS/X joystick: Check usage page to avoid odd non-button elements found…

dinput: OS/X joystick: Check usage page to avoid odd non-button elements found on the 360 controller.
parent c95011dc
......@@ -320,6 +320,13 @@ static void get_osx_device_elements(JoystickImpl *device, int axis_map[8])
{
case kIOHIDElementTypeInput_Button:
{
int usagePage = IOHIDElementGetUsagePage( tIOHIDElementRef );
if (usagePage != kHIDPage_Button)
{
/* avoid strange elements found on the 360 controler */
continue;
}
if (buttons < 128)
{
CFArrayInsertValueAtIndex(device->elementCFArrayRef, (axes+povs+buttons), tIOHIDElementRef);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment