Mac: Fix HID parsing for gamepads

This commit is contained in:
Michael Buckley 2020-01-12 15:47:58 -08:00
parent 04692e1ee4
commit b11657cd0f
1 changed files with 6 additions and 8 deletions

View File

@ -274,7 +274,7 @@ void findControls(struct JoypadDevice &device, NSDictionary *properties, NSMutab
if (properties == nil)
{
return;
}
}
int usagePage = [properties[@kIOHIDElementUsagePageKey] intValue];
int usage = [properties[@kIOHIDElementUsageKey] intValue];
@ -293,13 +293,11 @@ void findControls(struct JoypadDevice &device, NSDictionary *properties, NSMutab
*hat = [properties[@kIOHIDElementCookieKey] intValue];
}
}
else
{
for ( NSDictionary *child in properties[@kIOHIDElementKey] )
{
findControls(device, child, buttons, axes, hat);
}
}
for ( NSDictionary *child in properties[@kIOHIDElementKey] )
{
findControls(device, child, buttons, axes, hat);
}
}
void ParseDefaults (void)