0

Add support for the 8BitDo Ultimate 2C Wireless controller on macOS

Use the Xbox bluetooth mapping for this controller when on macOS.
Without this patch, the controller has no mapping and passes
the inputs through directly.

R=mattreynolds

Bug: 417410412
Change-Id: I1c3f3e1d2bf01382844f7285d09c38d9256a6e8d
Fixed: 417410412
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6541167
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1464397}
This commit is contained in:
Isaac Khor
2025-05-22 15:23:58 -07:00
committed by Chromium LUCI CQ
parent e1a7431cbd
commit 2d025e83c6
4 changed files with 11 additions and 0 deletions

@ -590,6 +590,7 @@ Imranur Rahman <i.rahman@samsung.com>
Imranur Rahman <ir.shimul@gmail.com>
Ion Rosca <rosca@adobe.com>
Irmak Kavasoglu <irmakkavasoglu@gmail.com>
Isaac Khor <dev@isaackhor.com>
Isaac Murchie <murchieisaac@gmail.com>
Isaac Reilly <reillyi@amazon.com>
Ivan Naydonov <samogot@gmail.com>

@ -613,6 +613,7 @@ constexpr auto kGamepadInfo = base::MakeFixedFlatMap<
{{0x2dc8, 0x2830}, kXInputTypeNone},
{{0x2dc8, 0x3000}, kXInputTypeNone},
{{0x2dc8, 0x3001}, kXInputTypeNone},
{{0x2dc8, 0x301b}, kXInputTypeNone},
{{0x2dc8, 0x3106}, kXInputTypeXbox360},
{{0x2dc8, 0x3820}, kXInputTypeNone},
{{0x2dc8, 0x9001}, kXInputTypeNone},

@ -42,6 +42,7 @@ enum class GamepadId : uint32_t {
// Fake IDs for devices which report as 0x0000 0x0000
kPowerALicPro = 0x0000ff00,
// ID values for supported devices.
k8BitDoProduct301b = 0x2dc8301b,
k8BitDoProduct3106 = 0x2dc83106,
kAcerProduct1304 = 0x05021304,
kAcerProduct1305 = 0x05021305,

@ -139,6 +139,12 @@ void MapperXboxSeriesXBluetooth(const Gamepad& input, Gamepad* mapped) {
mapped->axes_length = AXIS_INDEX_COUNT;
}
void Mapper8BitDoBluetooth(const Gamepad& input, Gamepad* mapped) {
MapperXboxBluetooth(input, mapped);
mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[4]);
mapped->buttons[BUTTON_INDEX_RIGHT_TRIGGER] = AxisToButton(input.axes[3]);
}
void MapperPlaystationSixAxis(const Gamepad& input, Gamepad* mapped) {
*mapped = input;
mapped->buttons[BUTTON_INDEX_PRIMARY] = input.buttons[14];
@ -782,6 +788,8 @@ constexpr struct MappingData {
} kAvailableMappings[] = {
// PowerA Wireless Controller - Nintendo GameCube style
{GamepadId::kPowerALicPro, MapperSwitchPro},
// 8BitDo Ultimate Wireless 2C (Bluetooth)
{GamepadId::k8BitDoProduct301b, Mapper8BitDoBluetooth},
// Snakebyte iDroid:con
{GamepadId::kBroadcomProduct8502, MapperSnakebyteIDroidCon},
// DragonRise Generic USB