Aric Stewart : dinput: OS/X joystick: Check usage page to avoid odd non-button elements found on the 360 controller .

Alexandre Julliard julliard at winehq.org
Thu Mar 12 09:54:23 CDT 2009


Module: wine
Branch: master
Commit: 6bbec8e660911ab26198abb583b80e2d905efe23
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6bbec8e660911ab26198abb583b80e2d905efe23

Author: Aric Stewart <aric at codeweavers.com>
Date:   Wed Mar 11 15:06:31 2009 -0500

dinput: OS/X joystick: Check usage page to avoid odd non-button elements found on the 360 controller.

---

 dlls/dinput/joystick_osx.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c
index c8a333f..b44896c 100644
--- a/dlls/dinput/joystick_osx.c
+++ b/dlls/dinput/joystick_osx.c
@@ -320,6 +320,13 @@ static void get_osx_device_elements(JoystickImpl *device, int axis_map[8])
             {
                 case kIOHIDElementTypeInput_Button:
                 {
+                    int usagePage = IOHIDElementGetUsagePage( tIOHIDElementRef );
+                    if (usagePage != kHIDPage_Button)
+                    {
+                        /* avoid strange elements found on the 360 controler */
+                        continue;
+                    }
+
                     if (buttons < 128)
                     {
                         CFArrayInsertValueAtIndex(device->elementCFArrayRef, (axes+povs+buttons), tIOHIDElementRef);




More information about the wine-cvs mailing list