From 2223a843c9caeff06f3024bcc09e90a5b069a119 Mon Sep 17 00:00:00 2001 From: byuu <2107894+byuu@users.noreply.github.com> Date: Sun, 23 Feb 2020 20:34:10 +0900 Subject: [PATCH] Restore IOKit fix that was missing from higan ruby sync. --- ruby/input/joypad/iokit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ruby/input/joypad/iokit.cpp b/ruby/input/joypad/iokit.cpp index 2b9d516a..679ffcea 100644 --- a/ruby/input/joypad/iokit.cpp +++ b/ruby/input/joypad/iokit.cpp @@ -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