diff --git a/src/controllers/hid/hiddenylist.h b/src/controllers/hid/hiddenylist.h index 12978932e7a..10c7f4eba30 100644 --- a/src/controllers/hid/hiddenylist.h +++ b/src/controllers/hid/hiddenylist.h @@ -10,12 +10,12 @@ typedef struct hid_denylist { /// USB HID device that should not be recognized as controllers hid_denylist_t hid_denylisted[] = { - {0x5ac, 0x253, 0xff00, 0x1, -1}, // Apple laptop chassis - {0x5ac, 0x8242, 0xc, 0x1, -1}, // Apple IR Remote Controller {0x1157, 0x300, 0x1, 0x2, -1}, // EKS Otus mouse pad (OS/X,windows) {0x1157, 0x300, 0x0, 0x0, 0x3}, // EKS Otus mouse pad (linux) }; +constexpr unsigned short kAppleVendorId = 0x5ac; + constexpr unsigned short kGenericDesktopUsagePage = 0x01; constexpr unsigned short kGenericDesktopMouseUsage = 0x02; diff --git a/src/controllers/hid/hidenumerator.cpp b/src/controllers/hid/hidenumerator.cpp index f17c0c391f9..ec7aec6b758 100644 --- a/src/controllers/hid/hidenumerator.cpp +++ b/src/controllers/hid/hidenumerator.cpp @@ -17,6 +17,16 @@ bool recognizeDevice(const hid_device_info& device_info) { return false; } + // Apple includes a variety of HID devices in their computers, not all of which + // match the filter above for keyboards and mice, for example "Magic Trackpad", + // "Internal Keyboard", and "T1 Controller". Apple is likely to keep changing + // these devices in future computers and none of these devices are DJ controllers, + // so skip all Apple HID devices rather than maintaining a list of specific devices + // to skip. + if (device_info.vendor_id == kAppleVendorId) { + return false; + } + // Exclude specific devices from the denylist. bool interface_number_valid = device_info.interface_number != -1; const int denylist_len = sizeof(hid_denylisted) / sizeof(hid_denylisted[0]);