From fda2d32d2d8c8bb479ed471155b70f9a75bb874b Mon Sep 17 00:00:00 2001 From: thefiddler Date: Sun, 5 Jan 2014 22:44:58 +0100 Subject: [PATCH] [Mac] Map GamePads, MultiAxisControllers and Wheels to joysticks --- Source/OpenTK/Platform/MacOS/HIDInput.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/OpenTK/Platform/MacOS/HIDInput.cs b/Source/OpenTK/Platform/MacOS/HIDInput.cs index 024d85cc..25cdd15e 100755 --- a/Source/OpenTK/Platform/MacOS/HIDInput.cs +++ b/Source/OpenTK/Platform/MacOS/HIDInput.cs @@ -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;