Browse Source

Remove GameSir-G7 Pro

chenzw 1 month ago
parent
commit
6ae268ba17
3 changed files with 5 additions and 15 deletions
  1. 1 2
      src/joystick/SDL_joystick.c
  2. 3 11
      src/joystick/hidapi/SDL_hidapi_gamesir.c
  3. 1 2
      src/joystick/usb_ids.h

+ 1 - 2
src/joystick/SDL_joystick.c

@@ -3320,8 +3320,7 @@ bool SDL_IsJoystickGameSirController(Uint16 vendor_id, Uint16 product_id)
         return false;
     }
 
-    return (product_id == USB_PRODUCT_GAMESIR_GAMEPAD_G7_PRO_HID ||
-            product_id == USB_PRODUCT_GAMESIR_GAMEPAD_G7_PRO_8K_HID);
+    return (product_id == USB_PRODUCT_GAMESIR_GAMEPAD_G7_PRO_8K);
 }
 
 bool SDL_IsJoystickSteamDeck(Uint16 vendor_id, Uint16 product_id)

+ 3 - 11
src/joystick/hidapi/SDL_hidapi_gamesir.c

@@ -110,9 +110,7 @@ static void HIDAPI_DriverGameSir_UnregisterHints(SDL_HintCallback callback, void
 
 static bool HIDAPI_DriverGameSir_IsEnabled(void)
 {
-    // Temporarily disabled by default until response from GameSir
-    //return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_GAMESIR, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT));
-    return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_GAMESIR, false);
+    return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_GAMESIR, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT));
 }
 
 
@@ -354,14 +352,8 @@ static bool HIDAPI_DriverGameSir_InitDevice(SDL_HIDAPI_Device *device)
     ctx->output_handle = GetOutputHandle(device);
 
     switch (device->product_id) {
-    case USB_PRODUCT_GAMESIR_GAMEPAD_G7_PRO_HID:
-        HIDAPI_SetDeviceName(device, "GameSir-G7 Pro (HID)");
-        ctx->sensors_supported = true;
-        ctx->led_supported = false;
-        SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "GameSir: Device detected - G7 Pro HID mode (PID 0x%04X)", device->product_id);
-        break;
-    case USB_PRODUCT_GAMESIR_GAMEPAD_G7_PRO_8K_HID:
-        HIDAPI_SetDeviceName(device, "GameSir-G7 Pro 8K (HID)");
+    case USB_PRODUCT_GAMESIR_GAMEPAD_G7_PRO_8K:
+        HIDAPI_SetDeviceName(device, "GameSir-G7 Pro 8K");
         ctx->sensors_supported = true;
         ctx->led_supported = false;
         SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "GameSir: Device detected - G7 Pro 8K HID mode (PID 0x%04X)", device->product_id);

+ 1 - 2
src/joystick/usb_ids.h

@@ -85,8 +85,7 @@
 #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_GAMESIR_GAMEPAD_G7_PRO_8K         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