Restore IOKit fix that was missing from higan ruby sync.

This commit is contained in:
byuu 2020-02-23 20:34:10 +09:00
parent d2211d8818
commit 2223a843c9
1 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@ struct InputJoypadIOKit {
for(uint n : range(CFArrayGetCount(elements))) {
IOHIDElementRef element = (IOHIDElementRef)CFArrayGetValueAtIndex(elements, n);
IOHIDElementType type = IOHIDElementGetType(element);
uint32_t page = IOHIDElementGetUsagePage(element);
uint32_t usage = IOHIDElementGetUsage(element);
switch(type) {
case kIOHIDElementTypeInput_Button:
@ -21,6 +22,7 @@ struct InputJoypadIOKit {
break;
case kIOHIDElementTypeInput_Axis:
case kIOHIDElementTypeInput_Misc:
if(page != kHIDPage_GenericDesktop && page != kHIDPage_Simulation) break;
if(usage == kHIDUsage_Sim_Accelerator || usage == kHIDUsage_Sim_Brake
|| usage == kHIDUsage_Sim_Rudder || usage == kHIDUsage_Sim_Throttle
|| usage == kHIDUsage_GD_X || usage == kHIDUsage_GD_Y || usage == kHIDUsage_GD_Z