Fix JoyCon pair type detection on the web

(cherry picked from commit 5e54decf53)
This commit is contained in:
Nintorch
2026-06-12 13:28:21 +05:00
committed by Sam Lantinga
parent d4d6f50736
commit fdab62170e

View File

@@ -3039,6 +3039,8 @@ SDL_GamepadType SDL_GetGamepadTypeFromVIDPID(Uint16 vendor, Uint16 product, cons
} else if (vendor == USB_VENDOR_NINTENDO && product == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_GRIP) {
if (name && SDL_strstr(name, "(L)") != NULL) {
type = SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT;
} else if (name && SDL_strstr(name, "L+R") != NULL) {
type = SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR;
} else {
type = SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT;
}