Browse files

[Mac] Map GamePads, MultiAxisControllers and Wheels to joysticks

  • Loading branch information...
1 parent a112383 commit fda2d32d2d8c8bb479ed471155b70f9a75bb874b @thefiddler thefiddler committed Jan 5, 2014
Showing with 11 additions and 2 deletions.
  1. +11 −2 Source/OpenTK/Platform/MacOS/HIDInput.cs
View
13 Source/OpenTK/Platform/MacOS/HIDInput.cs
@@ -165,8 +165,17 @@ void DeviceAdded(IntPtr context, IOReturn res, IntPtr sender, IOHIDDeviceRef dev
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;

0 comments on commit fda2d32

Please sign in to comment.