From ab85afd5ba58f51f4ee3901e26a4c3b9d36e9041 Mon Sep 17 00:00:00 2001 From: thefiddler Date: Sun, 5 Jan 2014 22:36:01 +0100 Subject: [PATCH] [Mac] Avoid IOHIDDeviceConformsTo call in DeviceRemoved handler DeviceAdded already checks that devices conform to the desired usage pages. Checking again in DeviceRemoved is unnecessary - if a device exists, then it has already passed muster. --- Source/OpenTK/Platform/MacOS/HIDInput.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Source/OpenTK/Platform/MacOS/HIDInput.cs b/Source/OpenTK/Platform/MacOS/HIDInput.cs index 82aa7879..7454ff7e 100755 --- a/Source/OpenTK/Platform/MacOS/HIDInput.cs +++ b/Source/OpenTK/Platform/MacOS/HIDInput.cs @@ -196,22 +196,19 @@ namespace OpenTK.Platform.MacOS { bool recognized = false; - if (NativeMethods.IOHIDDeviceConformsTo(device, HIDPage.GenericDesktop, (int)HIDUsageGD.Mouse) && - MouseDevices.ContainsKey(device)) + if (MouseDevices.ContainsKey(device)) { RemoveMouse(sender, device); recognized = true; } - if (NativeMethods.IOHIDDeviceConformsTo(device, HIDPage.GenericDesktop, (int)HIDUsageGD.Keyboard) && - KeyboardDevices.ContainsKey(device)) + if (KeyboardDevices.ContainsKey(device)) { RemoveKeyboard(sender, device); recognized = true; } - if (NativeMethods.IOHIDDeviceConformsTo(device, HIDPage.GenericDesktop, (int)HIDUsageGD.Joystick) && - JoystickDevices.ContainsKey(device)) + if (JoystickDevices.ContainsKey(device)) { RemoveJoystick(sender, device); recognized = true;