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;
const uint32_t usage = IOHIDElementGetUsage(native);
switch (IOHIDElementGetUsagePage(native))
{
case kHIDPage_GenericDesktop:
const uint32_t usage = IOHIDElementGetUsage(native);
const uint32_t page = IOHIDElementGetUsagePage(native);
if (page == kHIDPage_GenericDesktop)
{
switch (usage)
{
@ -219,16 +218,9 @@ static void matchCallback(void* context,
target = hats;
break;
}
break;
}
case kHIDPage_Button:
else if (page == kHIDPage_Button)
target = buttons;
break;
default:
break;
}
if (target)
{