Commit d8fd78736b24e0e18338c8797d9effc18dbbc946

Sam Lantinga 2022-07-28T21:44:23

Added entry for the Nintendo Switch Joy-Con controller pair

diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index c6c4d83..37ae4a2 100644
--- a/src/joystick/SDL_joystick.c
+++ b/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));
 }
 
diff --git a/src/joystick/controller_type.c b/src/joystick/controller_type.c
index f10cd55..848b111 100644
--- a/src/joystick/controller_type.c
+++ b/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: