diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 406d148e3..5f74ec4d6 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -1687,10 +1687,13 @@ static SDL_bool SDL_IsPS4RemapperRunning(void) SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid) { - /* This list is taken from: + /* This list (except for marked entries at the top) is taken from: https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/generate_rules.py */ static Uint32 joystick_blacklist[] = { + /* Sound BlasterX G1 */ + MAKE_VIDPID(0x041E, 0x3249), + /* Microsoft Microsoft Wireless Optical DesktopĀ® 2.10 */ /* Microsoft Wireless Desktop - Comfort Edition */ MAKE_VIDPID(0x045e, 0x009d), diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index ada3088a7..579d0965c 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -413,7 +413,7 @@ HIDAPI_GetDeviceDriver(SDL_HIDAPI_Device *device) const Uint16 USAGE_GAMEPAD = 0x0005; const Uint16 USAGE_MULTIAXISCONTROLLER = 0x0008; int i; - SDL_GameControllerType type = SDL_GetJoystickGameControllerType(device->name, device->vendor_id, device->product_id, device->interface_number, device->interface_class, device->interface_subclass, device->interface_protocol); + SDL_GameControllerType type; if (SDL_ShouldIgnoreJoystick(device->name, device->guid)) { return NULL; @@ -426,6 +426,7 @@ HIDAPI_GetDeviceDriver(SDL_HIDAPI_Device *device) 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); for (i = 0; i < SDL_arraysize(SDL_HIDAPI_drivers); ++i) { SDL_HIDAPI_DeviceDriver *driver = SDL_HIDAPI_drivers[i]; if (driver->enabled && driver->IsSupportedDevice(device->name, type, device->vendor_id, device->product_id, device->version, device->interface_number, device->interface_class, device->interface_subclass, device->interface_protocol)) {