This commit is contained in:
Camilla Löwy 2017-07-04 17:22:29 +02:00
parent 6634c47e57
commit ea6c50d9e2

View File

@ -196,11 +196,10 @@ static void matchCallback(void* context,
} }
CFMutableArrayRef target = NULL; CFMutableArrayRef target = NULL;
const uint32_t usage = IOHIDElementGetUsage(native);
switch (IOHIDElementGetUsagePage(native)) const uint32_t usage = IOHIDElementGetUsage(native);
{ const uint32_t page = IOHIDElementGetUsagePage(native);
case kHIDPage_GenericDesktop: if (page == kHIDPage_GenericDesktop)
{ {
switch (usage) switch (usage)
{ {
@ -219,16 +218,9 @@ static void matchCallback(void* context,
target = hats; target = hats;
break; break;
} }
break;
} }
else if (page == kHIDPage_Button)
case kHIDPage_Button:
target = buttons; target = buttons;
break;
default:
break;
}
if (target) if (target)
{ {