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

@@ -960,6 +960,16 @@ 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 */
if (!parse_hid_vid_pid_from_sysfs(sysfs_path, &bus_type, &dev_vid, &dev_pid))
continue;
if (HIDAPI_IGNORE_DEVICE(dev_vid, dev_pid)) {
continue;
}
#endif
raw_dev = udev_device_new_from_syspath(udev, sysfs_path);
if (!raw_dev)
continue;