Pārlūkot izejas kodu

Added entry for the Nintendo Switch Joy-Con controller pair

Sam Lantinga 2 gadi atpakaļ
vecāks
revīzija
d8fd78736b
2 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 1 0
      src/joystick/SDL_joystick.c
  2. 1 0
      src/joystick/controller_type.c

+ 1 - 0
src/joystick/SDL_joystick.c

@@ -2120,6 +2120,7 @@ SDL_IsJoystickNintendoSwitchPro(Uint16 vendor_id, Uint16 product_id)
     EControllerType eType = GuessControllerType(vendor_id, product_id);
     return (eType == k_eControllerType_SwitchProController ||
             eType == k_eControllerType_SwitchInputOnlyController ||
+            eType == k_eControllerType_SwitchJoyConPair ||
             (vendor_id == USB_VENDOR_NINTENDO && product_id == USB_PRODUCT_NINTENDO_SWITCH_JOY_CON_GRIP));
 }
 

+ 1 - 0
src/joystick/controller_type.c

@@ -527,6 +527,7 @@ static const ControllerDescription_t arrControllers[] = {
     // We now support Joy-Cons if SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS is set to "1", but they won't be combined into one controller.
     { MAKE_CONTROLLER_ID( 0x057e, 0x2006 ), k_eControllerType_SwitchJoyConLeft, NULL },    // Nintendo Switch Joy-Con (Left)
     { MAKE_CONTROLLER_ID( 0x057e, 0x2007 ), k_eControllerType_SwitchJoyConRight, NULL },   // Nintendo Switch Joy-Con (Right)
+    { MAKE_CONTROLLER_ID( 0x057e, 0x2008 ), k_eControllerType_SwitchJoyConPair, NULL },    // Nintendo Switch Joy-Con (Left+Right Combined)
 
     // This same controller ID is spoofed by many 3rd-party Switch controllers.
     // The ones we currently know of are: