mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-19 04:28:58 +00:00
hidapi: do not enumerate XInput devices owned by a kernel driver via libusb on macOS
This commit is contained in:
parent
2ebb96b881
commit
cee2cb8ed1
1 changed files with 11 additions and 0 deletions
|
|
@ -1069,6 +1069,17 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
|
|||
struct hid_device_info *tmp;
|
||||
|
||||
res = libusb_open(dev, &handle);
|
||||
#ifdef SDL_PLATFORM_MACOS
|
||||
if (res == 0) {
|
||||
/* Do not enumerate XInput devices already owned by a kernel driver */
|
||||
int is_xbox = is_xbox360(dev_vid, intf_desc) || is_xboxone(dev_vid, intf_desc);
|
||||
if (is_xbox && libusb_kernel_driver_active(handle, intf_desc->bInterfaceNumber) == 1) {
|
||||
libusb_close(handle);
|
||||
handle = NULL;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __ANDROID__
|
||||
if (handle) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue