mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user