Added SDL_HINT_HIDAPI_IGNORE_DEVICES to specify devices that should be ignored in SDL_hid_enumerate()

This commit is contained in:
Sam Lantinga
2023-05-24 22:37:38 -07:00
parent e6834a1535
commit 007c36e513
9 changed files with 84 additions and 21 deletions

View File

@@ -833,6 +833,15 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
continue;
}
#ifdef HIDAPI_IGNORE_DEVICE
/* See if there are any devices we should skip in enumeration */
unsigned short dev_vid = get_vendor_id(dev);
unsigned short dev_pid = get_product_id(dev);
if (HIDAPI_IGNORE_DEVICE(dev_vid, dev_pid)) {
continue;
}
#endif
struct hid_device_info *tmp = create_device_info(dev);
if (tmp == NULL) {
continue;