dinput: OS/X joystick: Check usage page to avoid odd non-button elements found on the 360 controller.

This commit is contained in:
Aric Stewart 2009-03-11 15:06:31 -05:00 committed by Alexandre Julliard
parent c95011dc5c
commit 6bbec8e660
1 changed files with 7 additions and 0 deletions

View File

@ -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);