[Mac] Map GamePads, MultiAxisControllers and Wheels to joysticks
authorthefiddler <stapostol@gmail.com>
Sun, 5 Jan 2014 21:44:58 +0000 (22:44 +0100)
committerthefiddler <stapostol@gmail.com>
Sun, 5 Jan 2014 21:44:58 +0000 (22:44 +0100)
Source/OpenTK/Platform/MacOS/HIDInput.cs

index 024d85cc1b66351793c8ce8d88aeeb9fdd23e851..25cdd15e8e97ce9101f6a7aa1a85d383e166b5be 100755 (executable)
@@ -165,8 +165,17 @@ namespace OpenTK.Platform.MacOS
                         recognized = true;
                     }
 
-                    if (NativeMethods.IOHIDDeviceConformsTo(device,
-                        HIDPage.GenericDesktop, (int)HIDUsageGD.Joystick))
+                    bool is_joystick = false;
+                    is_joystick |= NativeMethods.IOHIDDeviceConformsTo(device,
+                        HIDPage.GenericDesktop, (int)HIDUsageGD.Joystick);
+                    is_joystick |= NativeMethods.IOHIDDeviceConformsTo(device,
+                        HIDPage.GenericDesktop, (int)HIDUsageGD.GamePad);
+                    is_joystick |= NativeMethods.IOHIDDeviceConformsTo(device,
+                        HIDPage.GenericDesktop, (int)HIDUsageGD.MultiAxisController);
+                    is_joystick |= NativeMethods.IOHIDDeviceConformsTo(device,
+                        HIDPage.GenericDesktop, (int)HIDUsageGD.Wheel);
+                    // Todo: any other interesting devices under HIDPage.Simulation + HIDUsageSim?
+                    if (is_joystick)
                     {
                         AddJoystick(sender, device);
                         recognized = true;