Added support for the GameSir-G7 Pro 8K controller

This commit is contained in:
chenzw
2026-01-30 20:53:18 +08:00
committed by Sam Lantinga
parent 1a9e6c368f
commit bb8eee8fac
13 changed files with 1089 additions and 0 deletions

View File

@@ -1266,6 +1266,8 @@ static GamepadMapping_t *SDL_CreateMappingForHIDAPIGamepad(SDL_GUID guid)
// Apex 5 has additional shoulder macro buttons
SDL_strlcat(mapping_string, "misc2:b15,misc3:b16,", sizeof(mapping_string));
}
} else if (SDL_IsJoystickGameSirController(vendor, product)) {
SDL_strlcat(mapping_string, "paddle1:b11,paddle2:b12,paddle3:b13,paddle4:b14,misc2:b15,misc3:b16,", sizeof(mapping_string));
} else if (vendor == USB_VENDOR_8BITDO && product == USB_PRODUCT_8BITDO_ULTIMATE2_WIRELESS) {
SDL_strlcat(mapping_string, "paddle1:b12,paddle2:b11,paddle3:b14,paddle4:b13,", sizeof(mapping_string));
} else {

View File

@@ -3314,6 +3314,16 @@ bool SDL_IsJoystickFlydigiController(Uint16 vendor_id, Uint16 product_id)
return false;
}
bool SDL_IsJoystickGameSirController(Uint16 vendor_id, Uint16 product_id)
{
if (vendor_id != USB_VENDOR_GAMESIR) {
return false;
}
return (product_id == USB_PRODUCT_GAMESIR_GAMEPAD_G7_PRO_HID ||
product_id == USB_PRODUCT_GAMESIR_GAMEPAD_G7_PRO_8K_HID);
}
bool SDL_IsJoystickSteamDeck(Uint16 vendor_id, Uint16 product_id)
{
EControllerType eType = GuessControllerType(vendor_id, product_id);

View File

@@ -141,6 +141,9 @@ extern bool SDL_IsJoystickSInputController(Uint16 vendor_id, Uint16 product_id);
// Function to return whether a joystick is a Flydigi controller
extern bool SDL_IsJoystickFlydigiController(Uint16 vendor_id, Uint16 product_id);
// Function to return whether a joystick is a GameSir controller
extern bool SDL_IsJoystickGameSirController(Uint16 vendor_id, Uint16 product_id);
// Function to return whether a joystick is a Steam Deck
extern bool SDL_IsJoystickSteamDeck(Uint16 vendor_id, Uint16 product_id);

File diff suppressed because it is too large Load Diff

View File

@@ -106,6 +106,9 @@ static SDL_HIDAPI_DeviceDriver *SDL_HIDAPI_drivers[] = {
#ifdef SDL_JOYSTICK_HIDAPI_SINPUT
&SDL_HIDAPI_DriverSInput,
#endif
#ifdef SDL_JOYSTICK_HIDAPI_GAMESIR
&SDL_HIDAPI_DriverGameSir,
#endif
#ifdef SDL_JOYSTICK_HIDAPI_ZUIKI
&SDL_HIDAPI_DriverZUIKI,
#endif

View File

@@ -47,6 +47,7 @@
#define SDL_JOYSTICK_HIDAPI_LG4FF
#define SDL_JOYSTICK_HIDAPI_8BITDO
#define SDL_JOYSTICK_HIDAPI_FLYDIGI
#define SDL_JOYSTICK_HIDAPI_GAMESIR
#define SDL_JOYSTICK_HIDAPI_GIP
#define SDL_JOYSTICK_HIDAPI_SINPUT
#define SDL_JOYSTICK_HIDAPI_ZUIKI
@@ -173,6 +174,7 @@ extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSteamTriton;
extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverLg4ff;
extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_Driver8BitDo;
extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverFlydigi;
extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverGameSir;
extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSInput;
extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverZUIKI;

View File

@@ -85,6 +85,8 @@
#define USB_PRODUCT_FLYDIGI_V1_GAMEPAD 0x2412
#define USB_PRODUCT_FLYDIGI_V2_APEX 0x2501
#define USB_PRODUCT_FLYDIGI_V2_VADER 0x2401
#define USB_PRODUCT_GAMESIR_GAMEPAD_G7_PRO_HID 0x1022 // Wired/2.4G/Bluetooth HID mode
#define USB_PRODUCT_GAMESIR_GAMEPAD_G7_PRO_8K_HID 0x10B8 // Wired/2.4G/Bluetooth 8K HID mode
#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