Added support for the Switch 2 Joy-Cons with charging grip

This commit is contained in:
Sam Lantinga
2025-08-30 09:52:08 -07:00
parent 6136ba7a74
commit 4b93e7488f
8 changed files with 549 additions and 130 deletions

View File

@@ -1388,7 +1388,15 @@ static bool HIDAPI_DriverSwitch_IsSupportedDevice(SDL_HIDAPI_Device *device, con
return false;
}
return (type == SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO);
if (type != SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO) {
return false;
}
// The Nintendo Switch 2 Pro uses another driver
if (vendor_id == USB_VENDOR_NINTENDO && product_id == USB_PRODUCT_NINTENDO_SWITCH2_PRO) {
return false;
}
return true;
}
static void UpdateDeviceIdentity(SDL_HIDAPI_Device *device)