diff options
| author | Jocelyn Turcotte <turcotte.j@gmail.com> | 2017-08-01 01:58:30 +0200 |
|---|---|---|
| committer | Jocelyn Turcotte <turcotte.j@gmail.com> | 2017-08-01 01:58:30 +0200 |
| commit | 200fb26148630d59e77f7a1574617b496df082a7 (patch) | |
| tree | c0f98ff6402a0ea0f9769c319705d19116e3ed8d /Source/Core/InputCommon/ControllerInterface | |
| parent | 131c97e87c203f2ea54410bf3b3ee59489369bbe (diff) | |
Fix axis not working with Switch Pro controller on macOS
Each axis would appear as multiple elements with 0 min/max.
Filter the list of elements using the correct usage page like
done for buttons.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm index e8595153f2..9bbd953a4b 100644 --- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm +++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm @@ -39,7 +39,10 @@ Joystick::Joystick(IOHIDDeviceRef device, std::string name) } // Axes - NSDictionary* axisDict = @{ @kIOHIDElementTypeKey : @(kIOHIDElementTypeInput_Misc) }; + NSDictionary* axisDict = @{ + @kIOHIDElementTypeKey : @(kIOHIDElementTypeInput_Misc), + @kIOHIDElementUsagePageKey : @(kHIDPage_GenericDesktop) + }; CFArrayRef axes = IOHIDDeviceCopyMatchingElements(m_device, (CFDictionaryRef)axisDict, kIOHIDOptionsTypeNone); |
