From b11657cd0f349a271c60041ff3e64f42b12a358f Mon Sep 17 00:00:00 2001 From: Michael Buckley Date: Sun, 12 Jan 2020 15:47:58 -0800 Subject: [PATCH] Mac: Fix HID parsing for gamepads --- macosx/mac-joypad.mm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/macosx/mac-joypad.mm b/macosx/mac-joypad.mm index 35a0388e..748d15f9 100755 --- a/macosx/mac-joypad.mm +++ b/macosx/mac-joypad.mm @@ -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)