From 56b91ea72069763512bd2128d3b1c485de3c581a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 23 Sep 2022 15:27:40 -0700 Subject: [PATCH] Fixed feature detection for the Razer Raiju Tournament Edition controller --- src/joystick/hidapi/SDL_hidapi_ps4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapi_ps4.c b/src/joystick/hidapi/SDL_hidapi_ps4.c index b95370882..d5b3d29bd 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps4.c +++ b/src/joystick/hidapi/SDL_hidapi_ps4.c @@ -309,10 +309,6 @@ HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device) ctx->effects_supported = SDL_TRUE; ctx->sensors_supported = SDL_TRUE; ctx->touchpad_supported = SDL_TRUE; - } else if (device->vendor_id == USB_VENDOR_RAZER && device->product_id == USB_PRODUCT_RAZER_RAIJU) { - /* This doesn't respond to the detection protocol, but has a touchpad and vibration */ - ctx->effects_supported = SDL_TRUE; - ctx->touchpad_supported = SDL_TRUE; } else if ((size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data))) == 48 && data[2] == 0x27) { Uint8 capabilities = data[4]; @@ -329,6 +325,10 @@ HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device) if ((capabilities & 0x40) != 0) { ctx->touchpad_supported = SDL_TRUE; } + } else if (device->vendor_id == USB_VENDOR_RAZER) { + /* The Razer Raiju doesn't respond to the detection protocol, but has a touchpad and vibration */ + ctx->effects_supported = SDL_TRUE; + ctx->touchpad_supported = SDL_TRUE; } device->type = SDL_CONTROLLER_TYPE_PS4;