Module: wine Branch: oldstable Commit: 7d506ed9339cfa9dd03b4c0987ad4e3cf17db211 URL: https://source.winehq.org/git/wine.git/?a=commit;h=7d506ed9339cfa9dd03b4c098... Author: Bob Ziuchkovski <bob.ziuchkovski(a)gmail.com> Date: Sun Jan 7 16:26:04 2018 -0700 dinput: Ignore vendor-specific usage pages for joystick elements on Mac. Signed-off-by: Bob Ziuchkovski <bob.ziuchkovski(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 221708d64ebf7b9c6bed3674e9363779a3ed1a4d) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/dinput/joystick_osx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c index 43fa20e..b0dcdd9 100644 --- a/dlls/dinput/joystick_osx.c +++ b/dlls/dinput/joystick_osx.c @@ -640,14 +640,20 @@ static void get_osx_device_elements(JoystickImpl *device, int axis_map[8]) { IOHIDElementRef element = ( IOHIDElementRef ) CFArrayGetValueAtIndex( elements, idx ); int type = IOHIDElementGetType( element ); + int usage_page = IOHIDElementGetUsagePage( element ); TRACE("element %s\n", debugstr_element(element)); + if (usage_page >= kHIDPage_VendorDefinedStart) + { + /* vendor pages can repurpose type ids, resulting in incorrect case matches below (e.g. ds4 controllers) */ + continue; + } + switch(type) { case kIOHIDElementTypeInput_Button: { - int usage_page = IOHIDElementGetUsagePage( element ); TRACE("kIOHIDElementTypeInput_Button usage_page %d\n", usage_page); if (usage_page != kHIDPage_Button) {