Apply recommended changes from review

https://github.com/snes9xgit/snes9x/pull/852#pullrequestreview-1451205573
This commit is contained in:
Seth Cantrell 2023-05-30 16:39:19 -04:00
parent 24cb5ce657
commit fa7922da4a

View File

@ -283,8 +283,9 @@ void findControls(struct JoypadDevice &device, NSDictionary *properties, NSMutab
int usagePage = [properties[@kIOHIDElementUsagePageKey] intValue];
int usage = [properties[@kIOHIDElementUsageKey] intValue];
if (usagePage == kHIDPage_Button ||
(usagePage == kHIDPage_GenericDesktop && (usage == kHIDUsage_GD_DPadUp || usage == kHIDUsage_GD_DPadDown || usage == kHIDUsage_GD_DPadLeft || usage == kHIDUsage_GD_DPadRight))
|| (usagePage == kHIDPage_Consumer && (usage == kHIDUsage_Csmr_ACProperties || usage == kHIDUsage_Csmr_ACExit)))
usagePage == kHIDPage_Consumer ||
(usagePage == kHIDPage_GenericDesktop && (usage == kHIDUsage_GD_DPadUp || usage == kHIDUsage_GD_DPadDown || usage == kHIDUsage_GD_DPadLeft || usage == kHIDUsage_GD_DPadRight ||
usage == kHIDUsage_GD_Start || usage == kHIDUsage_GD_Select || usage == kHIDUsage_GD_SystemMainMenu)))
{
[buttons addObject:properties];
}