mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-26 02:31:07 +01:00
Added support for the GameSir-G7 Pro 8K controller
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
1040
src/joystick/hidapi/SDL_hidapi_gamesir.c
Normal file
1040
src/joystick/hidapi/SDL_hidapi_gamesir.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user