|
@@ -721,26 +721,26 @@ static GamepadMapping_t *SDL_CreateMappingForHIDAPIGamepad(SDL_JoystickGUID guid
|
|
|
guid.data[15] == k_eSwitchDeviceInfoControllerType_JoyConRight)) {
|
|
|
switch (guid.data[15]) {
|
|
|
case k_eSwitchDeviceInfoControllerType_HVCLeft:
|
|
|
- SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,rightshoulder:b10,start:b6,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,rightshoulder:b10,start:b6,", sizeof(mapping_string));
|
|
|
break;
|
|
|
case k_eSwitchDeviceInfoControllerType_HVCRight:
|
|
|
- SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,rightshoulder:b10,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,rightshoulder:b10,", sizeof(mapping_string));
|
|
|
break;
|
|
|
case k_eSwitchDeviceInfoControllerType_NESLeft:
|
|
|
case k_eSwitchDeviceInfoControllerType_NESRight:
|
|
|
- SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,rightshoulder:b10,start:b6,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,rightshoulder:b10,start:b6,", sizeof(mapping_string));
|
|
|
break;
|
|
|
case k_eSwitchDeviceInfoControllerType_SNES:
|
|
|
- SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,lefttrigger:a4,rightshoulder:b10,righttrigger:a5,start:b6,x:b2,y:b3,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,lefttrigger:a4,rightshoulder:b10,righttrigger:a5,start:b6,x:b2,y:b3,", sizeof(mapping_string));
|
|
|
break;
|
|
|
case k_eSwitchDeviceInfoControllerType_N64:
|
|
|
- SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,start:b6,x:b2,y:b3,misc1:b15,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,start:b6,x:b2,y:b3,misc1:b11,", sizeof(mapping_string));
|
|
|
break;
|
|
|
case k_eSwitchDeviceInfoControllerType_SEGA_Genesis:
|
|
|
- SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,rightshoulder:b10,righttrigger:a5,start:b6,misc1:b15,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,rightshoulder:b10,righttrigger:a5,start:b6,misc1:b11,", sizeof(mapping_string));
|
|
|
break;
|
|
|
case k_eWiiExtensionControllerType_None:
|
|
|
- SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,start:b6,x:b2,y:b3,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,start:b6,x:b2,y:b3,", sizeof(mapping_string));
|
|
|
break;
|
|
|
case k_eWiiExtensionControllerType_Nunchuk:
|
|
|
{
|
|
@@ -757,67 +757,67 @@ static GamepadMapping_t *SDL_CreateMappingForHIDAPIGamepad(SDL_JoystickGUID guid
|
|
|
if (SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS, SDL_FALSE)) {
|
|
|
/* Vertical mode */
|
|
|
if (guid.data[15] == k_eSwitchDeviceInfoControllerType_JoyConLeft) {
|
|
|
- SDL_strlcat(mapping_string, "back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,misc1:b15,paddle2:b17,paddle4:b19,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,misc1:b11,paddle2:b13,paddle4:b15,", sizeof(mapping_string));
|
|
|
} else {
|
|
|
- SDL_strlcat(mapping_string, "a:b0,b:b1,guide:b5,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,paddle1:b16,paddle3:b18,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "a:b0,b:b1,guide:b5,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,paddle1:b12,paddle3:b14,", sizeof(mapping_string));
|
|
|
}
|
|
|
} else {
|
|
|
/* Mini gamepad mode */
|
|
|
if (guid.data[15] == k_eSwitchDeviceInfoControllerType_JoyConLeft) {
|
|
|
- SDL_strlcat(mapping_string, "a:b0,b:b1,guide:b5,leftshoulder:b9,leftstick:b7,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,paddle2:b17,paddle4:b19,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "a:b0,b:b1,guide:b5,leftshoulder:b9,leftstick:b7,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,paddle2:b13,paddle4:b15,", sizeof(mapping_string));
|
|
|
} else {
|
|
|
- SDL_strlcat(mapping_string, "a:b0,b:b1,guide:b5,leftshoulder:b9,leftstick:b7,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,paddle1:b16,paddle3:b18,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "a:b0,b:b1,guide:b5,leftshoulder:b9,leftstick:b7,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,paddle1:b12,paddle3:b14,", sizeof(mapping_string));
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
} else {
|
|
|
/* All other gamepads have the standard set of 19 buttons and 6 axes */
|
|
|
- SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", sizeof(mapping_string));
|
|
|
|
|
|
if (SDL_IsJoystickXboxSeriesX(vendor, product)) {
|
|
|
/* XBox Series X Controllers have a share button under the guide button */
|
|
|
- SDL_strlcat(mapping_string, "misc1:b15,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "misc1:b11,", sizeof(mapping_string));
|
|
|
} else if (SDL_IsJoystickXboxOneElite(vendor, product)) {
|
|
|
/* XBox One Elite Controllers have 4 back paddle buttons */
|
|
|
- SDL_strlcat(mapping_string, "paddle1:b15,paddle2:b17,paddle3:b16,paddle4:b18,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "paddle1:b11,paddle2:b13,paddle3:b12,paddle4:b14,", sizeof(mapping_string));
|
|
|
} else if (SDL_IsJoystickSteamController(vendor, product)) {
|
|
|
/* Steam controllers have 2 back paddle buttons */
|
|
|
- SDL_strlcat(mapping_string, "paddle1:b16,paddle2:b15,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "paddle1:b12,paddle2:b11,", sizeof(mapping_string));
|
|
|
} else if (SDL_IsJoystickNintendoSwitchJoyConPair(vendor, product)) {
|
|
|
/* The Nintendo Switch Joy-Con combined controllers has a share button and paddles */
|
|
|
- SDL_strlcat(mapping_string, "misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "misc1:b11,paddle1:b12,paddle2:b13,paddle3:b14,paddle4:b15,", sizeof(mapping_string));
|
|
|
} else if (SDL_IsJoystickAmazonLunaController(vendor, product)) {
|
|
|
/* Amazon Luna Controller has a mic button under the guide button */
|
|
|
- SDL_strlcat(mapping_string, "misc1:b15,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "misc1:b11,", sizeof(mapping_string));
|
|
|
} else if (SDL_IsJoystickGoogleStadiaController(vendor, product)) {
|
|
|
/* The Google Stadia controller has a share button and a Google Assistant button */
|
|
|
- SDL_strlcat(mapping_string, "misc1:b15,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "misc1:b11,", sizeof(mapping_string));
|
|
|
} else if (SDL_IsJoystickNVIDIASHIELDController(vendor, product)) {
|
|
|
/* The NVIDIA SHIELD controller has a share button between back and start buttons */
|
|
|
- SDL_strlcat(mapping_string, "misc1:b15,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "misc1:b11,", sizeof(mapping_string));
|
|
|
|
|
|
if (product == USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V103) {
|
|
|
/* The original SHIELD controller has a touchpad as well */
|
|
|
- SDL_strlcat(mapping_string, "touchpad:b16,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "touchpad:b12,", sizeof(mapping_string));
|
|
|
}
|
|
|
} else if (SDL_IsJoystickPS4(vendor, product)) {
|
|
|
/* PS4 controllers have an additional touchpad button */
|
|
|
- SDL_strlcat(mapping_string, "touchpad:b15,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "touchpad:b11,", sizeof(mapping_string));
|
|
|
} else if (SDL_IsJoystickPS5(vendor, product)) {
|
|
|
/* PS5 controllers have a microphone button and an additional touchpad button */
|
|
|
- SDL_strlcat(mapping_string, "touchpad:b15,misc1:b16,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "touchpad:b11,misc1:b12,", sizeof(mapping_string));
|
|
|
/* DualSense Edge controllers have paddles */
|
|
|
if (SDL_IsJoystickDualSenseEdge(vendor, product)) {
|
|
|
- SDL_strlcat(mapping_string, "paddle1:b20,paddle2:b19,paddle3:b18,paddle4:b17,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "paddle1:b16,paddle2:b15,paddle3:b14,paddle4:b13,", sizeof(mapping_string));
|
|
|
}
|
|
|
} else if (SDL_IsJoystickNintendoSwitchPro(vendor, product) ||
|
|
|
SDL_IsJoystickNintendoSwitchProInputOnly(vendor, product)) {
|
|
|
/* Nintendo Switch Pro controllers have a screenshot button */
|
|
|
- SDL_strlcat(mapping_string, "misc1:b15,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "misc1:b11,", sizeof(mapping_string));
|
|
|
} else if (vendor == 0 && product == 0) {
|
|
|
/* This is a Bluetooth Nintendo Switch Pro controller */
|
|
|
- SDL_strlcat(mapping_string, "misc1:b15,", sizeof(mapping_string));
|
|
|
+ SDL_strlcat(mapping_string, "misc1:b11,", sizeof(mapping_string));
|
|
|
}
|
|
|
}
|
|
|
|