Merge pull request #5860 from jturcotte/fix-macos-nswitch-axis

Fix axis not working with Switch Pro controller on macOS
This commit is contained in:
Scott Mansell 2017-08-07 13:44:07 +12:00 committed by GitHub
commit 3b5cad6682

View File

@ -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);