From f55cbdfd967db0710ea1cef95622ff4a26def88b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 20 Mar 2020 21:05:07 -0700 Subject: [PATCH] Allow Valve devices in driver check, we know they're well behaved controllers --- src/joystick/hidapi/SDL_hidapijoystick.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index ad7446161..04a1520a7 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -427,11 +427,13 @@ HIDAPI_GetDeviceDriver(SDL_HIDAPI_Device *device) } #endif - if (device->usage_page && device->usage_page != USAGE_PAGE_GENERIC_DESKTOP) { - return NULL; - } - if (device->usage && device->usage != USAGE_JOYSTICK && device->usage != USAGE_GAMEPAD && device->usage != USAGE_MULTIAXISCONTROLLER) { - return NULL; + if (device->vendor_id != USB_VENDOR_VALVE) { + if (device->usage_page && device->usage_page != USAGE_PAGE_GENERIC_DESKTOP) { + return NULL; + } + if (device->usage && device->usage != USAGE_JOYSTICK && device->usage != USAGE_GAMEPAD && device->usage != USAGE_MULTIAXISCONTROLLER) { + return NULL; + } } type = SDL_GetJoystickGameControllerType(device->name, device->vendor_id, device->product_id, device->interface_number, device->interface_class, device->interface_subclass, device->interface_protocol);