Use the new controller type for the Luna and Stadia controllers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c
index 90d11dc..f4e7a6f 100644
--- a/src/joystick/SDL_gamecontroller.c
+++ b/src/joystick/SDL_gamecontroller.c
@@ -593,10 +593,6 @@ static ControllerMapping_t *SDL_CreateMappingForHIDAPIController(SDL_JoystickGUI
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));
- } else if ((vendor == USB_VENDOR_AMAZON && product == USB_PRODUCT_AMAZON_LUNA_CONTROLLER) ||
- (vendor == BLUETOOTH_VENDOR_AMAZON && product == BLUETOOTH_PRODUCT_LUNA_CONTROLLER)) {
- /* Amazon Luna Controller has a mic button under the guide button */
- SDL_strlcat(mapping_string, "misc1:b15,", 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));
@@ -624,13 +620,18 @@ static ControllerMapping_t *SDL_CreateMappingForHIDAPIController(SDL_JoystickGUI
SDL_strlcat(mapping_string, "paddle1:b16,paddle3:b18,", sizeof(mapping_string));
}
break;
+ case SDL_CONTROLLER_TYPE_AMAZON_LUNA:
+ /* Amazon Luna Controller has a mic button under the guide button */
+ SDL_strlcat(mapping_string, "misc1:b15,", sizeof(mapping_string));
+ break;
+ case SDL_CONTROLLER_TYPE_GOOGLE_STADIA:
+ /* The Google Stadia controller has a share button and a Google Assistant button */
+ SDL_strlcat(mapping_string, "misc1:b15,", sizeof(mapping_string));
+ break;
default:
if (vendor == 0 && product == 0) {
/* This is a Bluetooth Nintendo Switch Pro controller */
SDL_strlcat(mapping_string, "misc1:b15,", sizeof(mapping_string));
- } else if (vendor == USB_VENDOR_GOOGLE && product == USB_PRODUCT_GOOGLE_STADIA_CONTROLLER) {
- /* The Google Stadia controller has a share button and a Google Assistant button */
- SDL_strlcat(mapping_string, "misc1:b15,", sizeof(mapping_string));
}
break;
}