SDL: Added entry for the Nintendo Switch Joy-Con controller pair

From d8fd78736b24e0e18338c8797d9effc18dbbc946 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 28 Jul 2022 21:44:23 -0700
Subject: [PATCH] Added entry for the Nintendo Switch Joy-Con controller pair

---
 src/joystick/SDL_joystick.c    | 1 +
 src/joystick/controller_type.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index c6c4d836caa..37ae4a27e2d 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 f10cd5560a2..848b111f298 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: