From b6a88b0339537d842fc59b2095d4eda80934b214 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 31 May 2023 10:49:46 -0700 Subject: [PATCH] Don't try to interpret Xbox controllers as raw HID devices on Windows These generate fake reports which don't include separate trigger axes, and the HIDAPI joystick driver doesn't understand this report format. --- src/hidapi/windows/hid.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hidapi/windows/hid.c b/src/hidapi/windows/hid.c index 33d3fd3072..0ddc40d03f 100644 --- a/src/hidapi/windows/hid.c +++ b/src/hidapi/windows/hid.c @@ -884,6 +884,11 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor HANDLE device_handle = INVALID_HANDLE_VALUE; HIDD_ATTRIBUTES attrib; + /* XInput devices don't get real HID reports and are better handled by the raw input driver */ + if (wcsstr(device_interface, L"&IG_") != NULL) { + continue; + } + /* Open read-only handle to the device */ device_handle = open_device(device_interface, FALSE);