Bob Ziuchkovski : dinput: Ignore vendor-specific usage pages for joystick elements on Mac.
Alexandre Julliard
julliard at winehq.org
Tue Jan 9 15:49:38 CST 2018
Module: wine
Branch: master
Commit: 221708d64ebf7b9c6bed3674e9363779a3ed1a4d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=221708d64ebf7b9c6bed3674e9363779a3ed1a4d
Author: Bob Ziuchkovski <bob.ziuchkovski at 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 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at 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)
{
More information about the wine-cvs
mailing list