Explorar o código

Fixed Ipega controllers being ignored in keyboard mode (thanks @AntTheAlchemist!)

Sam Lantinga hai 8 horas
pai
achega
13f91a67fc
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/joystick/SDL_gamepad.c

+ 5 - 1
src/joystick/SDL_gamepad.c

@@ -206,7 +206,7 @@ static const struct SDL_GamepadBlacklistWords SDL_gamepad_blacklist_words[] = {
     {"Synaptics ",      GAMEPAD_BLACKLIST_ANYWHERE}, // "Synaptics TM2768-001", "SynPS/2 Synaptics TouchPad"
     {"Trackpad",        GAMEPAD_BLACKLIST_ANYWHERE},
     {"Clickpad",        GAMEPAD_BLACKLIST_ANYWHERE},
-    // "PG-90215 Keyboard", "Usb Keyboard Usb Keyboard Consumer Control", "Framework Laptop 16 Keyboard Module - ISO System Control"
+    // "Usb Keyboard Usb Keyboard Consumer Control", "Framework Laptop 16 Keyboard Module - ISO System Control"
     {" Keyboard",       GAMEPAD_BLACKLIST_ANYWHERE},
     {" Laptop ",        GAMEPAD_BLACKLIST_ANYWHERE}, // "Framework Laptop 16 Numpad Module System Control"
     {"Mouse ",          GAMEPAD_BLACKLIST_BEGIN}, // "Mouse passthrough"
@@ -3281,6 +3281,10 @@ bool SDL_ShouldIgnoreGamepad(Uint16 vendor_id, Uint16 product_id, Uint16 version
 
                 case GAMEPAD_BLACKLIST_ANYWHERE:
                     if (SDL_strstr(name, blacklist_word->str) != NULL) {
+                        if (SDL_startswith(name, "PG-") {
+                            // Ipega gamepads have modes with keyboard keys in addition to gamepad controls
+                            break;
+                        }
                         return true;
                     }
                     break;