From c2ae2ccc3258b6e75d943e00def6fc22cc5ff0b6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 23 Sep 2022 09:10:51 -0700 Subject: [PATCH] Added feature support for the Razer Raiju to the HIDAPI driver --- src/joystick/hidapi/SDL_hidapi_ps4.c | 4 ++++ src/joystick/usb_ids.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/joystick/hidapi/SDL_hidapi_ps4.c b/src/joystick/hidapi/SDL_hidapi_ps4.c index 205e70f43..b95370882 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps4.c +++ b/src/joystick/hidapi/SDL_hidapi_ps4.c @@ -309,6 +309,10 @@ 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]; diff --git a/src/joystick/usb_ids.h b/src/joystick/usb_ids.h index e9f27fb4c..301de649c 100644 --- a/src/joystick/usb_ids.h +++ b/src/joystick/usb_ids.h @@ -81,9 +81,10 @@ #define USB_PRODUCT_NINTENDO_WII_REMOTE 0x0306 #define USB_PRODUCT_NINTENDO_WII_REMOTE2 0x0330 #define USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER 0x7214 +#define USB_PRODUCT_RAZER_ATROX 0x0a00 #define USB_PRODUCT_RAZER_PANTHERA 0x0401 #define USB_PRODUCT_RAZER_PANTHERA_EVO 0x1008 -#define USB_PRODUCT_RAZER_ATROX 0x0a00 +#define USB_PRODUCT_RAZER_RAIJU 0x1000 #define USB_PRODUCT_SHANWAN_DS3 0x0523 #define USB_PRODUCT_SONY_DS3 0x0268 #define USB_PRODUCT_SONY_DS4 0x05c4