Commit 28da6c5ddb98b92b1cc0e92876f5044dc3648190

Patrick Hogan 2021-05-27T14:42:03

Have HIDAPI skip MFI supported HID devices on macOS to avoid duplicate devices.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/hidapi/mac/hid.c b/src/hidapi/mac/hid.c
index bdaa612..79bcff8 100644
--- a/src/hidapi/mac/hid.c
+++ b/src/hidapi/mac/hid.c
@@ -488,6 +488,13 @@ struct hid_device_info  HID_API_EXPORT *hid_enumerate(unsigned short vendor_id, 
 			continue;
 		}
 
+		#if defined(SDL_JOYSTICK_MFI) && defined(__MACOSX__)
+		extern SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device);
+		if (IOS_SupportedHIDDevice(dev)) {
+			continue;
+		}
+		#endif
+
 		dev_vid = get_vendor_id(dev);
 		dev_pid = get_product_id(dev);