Merge pull request #852 from socantre/master

Support Nimbus+ controller in mac-joypad.mm findControls()
This commit is contained in:
Michael Buckley 2023-05-30 17:29:03 -07:00 committed by GitHub
commit 02ebcb496a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -282,7 +282,10 @@ void findControls(struct JoypadDevice &device, NSDictionary *properties, NSMutab
int usagePage = [properties[@kIOHIDElementUsagePageKey] intValue];
int usage = [properties[@kIOHIDElementUsageKey] intValue];
if (usagePage == kHIDPage_Button)
if (usagePage == kHIDPage_Button ||
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];
}