mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-04 19:55:19 +00:00
Added an internal type for the Nintendo Switch 2 Pro controller
This commit is contained in:
parent
f31ca02723
commit
e759cc850e
3 changed files with 6 additions and 2 deletions
|
|
@ -3163,6 +3163,7 @@ SDL_GamepadType SDL_GetGamepadTypeFromVIDPID(Uint16 vendor, Uint16 product, cons
|
|||
}
|
||||
break;
|
||||
case k_eControllerType_SwitchProController:
|
||||
case k_eControllerType_Switch2ProController:
|
||||
case k_eControllerType_SwitchInputOnlyController:
|
||||
type = SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO;
|
||||
break;
|
||||
|
|
@ -3287,7 +3288,9 @@ bool SDL_IsJoystickDualSenseEdge(Uint16 vendor_id, Uint16 product_id)
|
|||
bool SDL_IsJoystickNintendoSwitchPro(Uint16 vendor_id, Uint16 product_id)
|
||||
{
|
||||
EControllerType eType = GuessControllerType(vendor_id, product_id);
|
||||
return eType == k_eControllerType_SwitchProController || eType == k_eControllerType_SwitchInputOnlyController;
|
||||
return eType == k_eControllerType_SwitchProController ||
|
||||
eType == k_eControllerType_Switch2ProController ||
|
||||
eType == k_eControllerType_SwitchInputOnlyController;
|
||||
}
|
||||
|
||||
bool SDL_IsJoystickNintendoSwitchProInputOnly(Uint16 vendor_id, Uint16 product_id)
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ static const ControllerDescription_t arrControllers[] = {
|
|||
// * ZhiXu Gamepad Wireless
|
||||
// * Sunwaytek Wireless Motion Controller for Nintendo Switch
|
||||
{ MAKE_CONTROLLER_ID( 0x057e, 0x2009 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Switch Pro Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x057e, 0x2069 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Switch 2 Pro Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x057e, 0x2069 ), k_eControllerType_Switch2ProController, NULL }, // Nintendo Switch 2 Pro Controller
|
||||
//{ MAKE_CONTROLLER_ID( 0x057e, 0x2017 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online SNES Controller
|
||||
//{ MAKE_CONTROLLER_ID( 0x057e, 0x2019 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online N64 Controller
|
||||
//{ MAKE_CONTROLLER_ID( 0x057e, 0x201e ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online SEGA Genesis Controller
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ typedef enum
|
|||
k_eControllerType_PS5EdgeController = 48,
|
||||
k_eControllerType_HoriSteamController = 49,
|
||||
k_eControllerType_8BitDoController = 50,
|
||||
k_eControllerType_Switch2ProController = 51,
|
||||
k_eControllerType_LastController, // Don't add game controllers below this enumeration - this enumeration can change value
|
||||
|
||||
// Keyboards and Mice
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue