From 08e3758e3f4fdfbe0f0e4caa6263bb904da5a983 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 15 Jul 2025 10:15:52 -0700
Subject: [PATCH] Added paddle bindings for the 8BitDo Pro 3 controller
---
src/joystick/SDL_gamepad.c | 5 ++++-
src/joystick/usb_ids.h | 8 ++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c
index 8a5ecc0ab9279..28aaf6a23da58 100644
--- a/src/joystick/SDL_gamepad.c
+++ b/src/joystick/SDL_gamepad.c
@@ -785,10 +785,13 @@ static GamepadMapping_t *SDL_CreateMappingForHIDAPIGamepad(SDL_GUID guid)
product == USB_PRODUCT_8BITDO_SN30_PRO ||
product == USB_PRODUCT_8BITDO_SN30_PRO_BT ||
product == USB_PRODUCT_8BITDO_PRO_2 ||
- product == USB_PRODUCT_8BITDO_PRO_2_BT)) {
+ product == USB_PRODUCT_8BITDO_PRO_2_BT ||
+ product == USB_PRODUCT_8BITDO_PRO_3)) {
SDL_strlcat(mapping_string, "a:b1,b:b0,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:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", sizeof(mapping_string));
if (product == USB_PRODUCT_8BITDO_PRO_2 || product == USB_PRODUCT_8BITDO_PRO_2_BT) {
SDL_strlcat(mapping_string, "paddle1:b14,paddle2:b13,", sizeof(mapping_string));
+ } else if (product == USB_PRODUCT_8BITDO_PRO_3) {
+ SDL_strlcat(mapping_string, "paddle1:b12,paddle2:b11,paddle3:b14,paddle4:b13,", sizeof(mapping_string));
}
} else if (vendor == USB_VENDOR_8BITDO &&
(product == USB_PRODUCT_8BITDO_SF30_PRO ||
diff --git a/src/joystick/usb_ids.h b/src/joystick/usb_ids.h
index ba75bbb8d6bbe..35c92a5882e0f 100644
--- a/src/joystick/usb_ids.h
+++ b/src/joystick/usb_ids.h
@@ -64,10 +64,10 @@
#define USB_PRODUCT_8BITDO_SF30_PRO_BT 0x6100 // B + START
#define USB_PRODUCT_8BITDO_SN30_PRO 0x6001 // B + START
#define USB_PRODUCT_8BITDO_SN30_PRO_BT 0x6101 // B + START
-#define USB_PRODUCT_8BITDO_PRO_2 0x6003 // mode switch to D
-#define USB_PRODUCT_8BITDO_PRO_2_BT 0x6006 // mode switch to D
-#define USB_PRODUCT_8BITDO_PRO_3 0x6009 // mode switch to D
-#define USB_PRODUCT_8BITDO_ULTIMATE2_WIRELESS 0x6012 // mode switch to BT
+#define USB_PRODUCT_8BITDO_PRO_2 0x6003 // mode switch to D
+#define USB_PRODUCT_8BITDO_PRO_2_BT 0x6006 // mode switch to D
+#define USB_PRODUCT_8BITDO_PRO_3 0x6009 // mode switch to D
+#define USB_PRODUCT_8BITDO_ULTIMATE2_WIRELESS 0x6012 // mode switch to BT
#define USB_PRODUCT_AMAZON_LUNA_CONTROLLER 0x0419
#define USB_PRODUCT_ASTRO_C40_XBOX360 0x0024
#define USB_PRODUCT_BACKBONE_ONE_IOS 0x0103