From 0b460f34ba70394e33637ab1470efb59b5bdfeab Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 3 Nov 2023 14:47:20 -0700 Subject: [PATCH] The HP HyperX controllers have a share button --- src/hidapi/libusb/hid.c | 2 +- src/joystick/SDL_joystick.c | 6 ++++++ src/joystick/usb_ids.h | 8 ++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c index 3cdb891020..b063dafe39 100644 --- a/src/hidapi/libusb/hid.c +++ b/src/hidapi/libusb/hid.c @@ -868,7 +868,7 @@ static int is_xboxone(unsigned short vendor_id, const struct libusb_interface_de static const int xb1_iface_subclass = 71; static const int xb1_iface_protocol = 208; static const int supported_vendors[] = { - 0x03f0, /* HP */ + 0x03f0, /* HP */ 0x044f, /* Thrustmaster */ 0x045e, /* Microsoft */ 0x0738, /* Mad Catz */ diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index d657b02acb..cd17d285cd 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -2479,6 +2479,12 @@ SDL_bool SDL_IsJoystickXboxSeriesX(Uint16 vendor_id, Uint16 product_id) return SDL_TRUE; } } + if (vendor_id == USB_VENDOR_HP) { + if (product_id == USB_PRODUCT_XBOX_SERIES_X_HP_HYPERX || + product_id == USB_PRODUCT_XBOX_SERIES_X_HP_HYPERX_RGB) { + return SDL_TRUE; + } + } if (vendor_id == USB_VENDOR_RAZER) { if (product_id == USB_PRODUCT_RAZER_WOLVERINE_V2 || product_id == USB_PRODUCT_RAZER_WOLVERINE_V2_CHROMA) { diff --git a/src/joystick/usb_ids.h b/src/joystick/usb_ids.h index 773e58f7c9..3da1c24991 100644 --- a/src/joystick/usb_ids.h +++ b/src/joystick/usb_ids.h @@ -33,6 +33,7 @@ #define USB_VENDOR_DRAGONRISE 0x0079 #define USB_VENDOR_GOOGLE 0x18d1 #define USB_VENDOR_HORI 0x0f0d +#define USB_VENDOR_HP 0x03f0 #define USB_VENDOR_HYPERKIN 0x2e24 #define USB_VENDOR_LOGITECH 0x046d #define USB_VENDOR_MADCATZ 0x0738 @@ -66,6 +67,7 @@ #define USB_PRODUCT_HORI_HORIPAD_PRO_SERIES_X 0x014f #define USB_PRODUCT_HORI_FIGHTING_STICK_ALPHA_PS4 0x011c #define USB_PRODUCT_HORI_FIGHTING_STICK_ALPHA_PS5 0x0184 +#define USB_PRODUCT_HORI_FIGHTING_STICK_ALPHA_PS5 0x0184 #define USB_PRODUCT_LOGITECH_F310 0xc216 #define USB_PRODUCT_LOGITECH_CHILLSTREAM 0xcad1 #define USB_PRODUCT_NINTENDO_GAMECUBE_ADAPTER 0x0337 @@ -125,12 +127,14 @@ #define USB_PRODUCT_XBOX_ONE_S_REV2_BLE 0x0b20 #define USB_PRODUCT_XBOX_SERIES_X 0x0b12 #define USB_PRODUCT_XBOX_SERIES_X_BLE 0x0b13 -#define USB_PRODUCT_XBOX_SERIES_X_VICTRIX_GAMBIT 0x02d6 -#define USB_PRODUCT_XBOX_SERIES_X_PDP_BLUE 0x02d9 +#define USB_PRODUCT_XBOX_SERIES_X_HP_HYPERX 0x08b6 +#define USB_PRODUCT_XBOX_SERIES_X_HP_HYPERX_RGB 0x07a0 #define USB_PRODUCT_XBOX_SERIES_X_PDP_AFTERGLOW 0x02da +#define USB_PRODUCT_XBOX_SERIES_X_PDP_BLUE 0x02d9 #define USB_PRODUCT_XBOX_SERIES_X_POWERA_FUSION_PRO2 0x4001 #define USB_PRODUCT_XBOX_SERIES_X_POWERA_MOGA_XP_ULTRA 0x890b #define USB_PRODUCT_XBOX_SERIES_X_POWERA_SPECTRA 0x4002 +#define USB_PRODUCT_XBOX_SERIES_X_VICTRIX_GAMBIT 0x02d6 #define USB_PRODUCT_XBOX_ONE_XBOXGIP_CONTROLLER 0x02ff /* XBOXGIP driver software PID */ #define USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER 0x02fe /* Made up product ID for XInput */ #define USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD 0x11ff