mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 19:45:29 +00:00
[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.
This commit is contained in:
parent
9e223486f6
commit
ab85afd5ba
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue