Added support for the GameSir-G7 Controller for Xbox

main
Sam Lantinga 2023-05-11 17:44:56 -07:00
parent 80a8691098
commit 2e6c48dcb4
5 changed files with 15 additions and 4 deletions

View File

@ -284,6 +284,7 @@ public class HIDDeviceManager {
0x24c6, // PowerA
0x2dc8, // 8BitDo
0x2e24, // Hyperkin
0x3537, // GameSir
};
if (usbInterface.getId() == 0 &&

View File

@ -716,6 +716,7 @@ static int is_xboxone(unsigned short vendor_id, const struct libusb_interface_de
0x24c6, /* PowerA */
0x2dc8, /* 8BitDo */
0x2e24, /* Hyperkin */
0x3537, /* GameSir */
};
if (intf_desc->bInterfaceNumber == 0 &&

View File

@ -1831,11 +1831,12 @@ char *SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_n
} replacements[] = {
{ "ASTRO Gaming", "ASTRO" },
{ "Bensussen Deutsch & Associates,Inc.(BDA)", "BDA" },
{ "Guangzhou Chicken Run Network Technology Co., Ltd.", "GameSir" },
{ "HORI CO.,LTD", "HORI" },
{ "HORI CO.,LTD.", "HORI" },
{ "Mad Catz Inc.", "Mad Catz" },
{ "NVIDIA Corporation ", "" },
{ "Performance Designed Products", "PDP" },
{ "HORI CO.,LTD.", "HORI" },
{ "HORI CO.,LTD", "HORI" },
{ "Mad Catz Inc.", "Mad Catz" },
{ "QANBA USA, LLC", "Qanba" },
{ "QANBA USA,LLC", "Qanba" },
{ "Unknown ", "" },
@ -1946,7 +1947,7 @@ char *SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_n
for (i = 1; i < (len - 1); ++i) {
int matchlen = PrefixMatch(name, &name[i]);
while (matchlen > 0) {
if (name[matchlen] == ' ') {
if (name[matchlen] == ' ' || name[matchlen] == '-') {
SDL_memmove(name, name + matchlen + 1, len - matchlen);
break;
}
@ -2219,6 +2220,11 @@ SDL_bool SDL_IsJoystickXboxSeriesX(Uint16 vendor_id, Uint16 product_id)
return SDL_TRUE;
}
}
if (vendor_id == USB_VENDOR_GAMESIR) {
if (product_id == USB_PRODUCT_GAMESIR_G7) {
return SDL_TRUE;
}
}
return SDL_FALSE;
}

View File

@ -271,6 +271,7 @@ static SDL_GamepadType SDL_GetJoystickGameControllerProtocol(const char *name, U
0x24c6, /* PowerA */
0x2dc8, /* 8BitDo */
0x2e24, /* Hyperkin */
0x3537, /* GameSir */
};
int i;

View File

@ -29,6 +29,7 @@
#define USB_VENDOR_APPLE 0x05ac
#define USB_VENDOR_ASTRO 0x9886
#define USB_VENDOR_BACKBONE 0x358a
#define USB_VENDOR_GAMESIR 0x3537
#define USB_VENDOR_DRAGONRISE 0x0079
#define USB_VENDOR_GOOGLE 0x18d1
#define USB_VENDOR_HORI 0x0f0d
@ -58,6 +59,7 @@
#define USB_PRODUCT_ASTRO_C40_XBOX360 0x0024
#define USB_PRODUCT_BACKBONE_ONE_IOS 0x0103
#define USB_PRODUCT_BACKBONE_ONE_IOS_PS5 0x0104
#define USB_PRODUCT_GAMESIR_G7 0x1001
#define USB_PRODUCT_GOOGLE_STADIA_CONTROLLER 0x9400
#define USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER 0x1846
#define USB_PRODUCT_HORI_FIGHTING_COMMANDER_OCTA_SERIES_X 0x0150