From 264eb8d4402d2a9ccdf167e196009afa498e9626 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 21 May 2025 13:30:00 -0700
Subject: [PATCH] Fixed the Bluetooth flag for the combined Joy-Con controller
---
src/joystick/hidapi/SDL_hidapijoystick.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c
index a616db3b9a8b4..2c9f7937d8061 100644
--- a/src/joystick/hidapi/SDL_hidapijoystick.c
+++ b/src/joystick/hidapi/SDL_hidapijoystick.c
@@ -1065,6 +1065,11 @@ static bool HIDAPI_CreateCombinedJoyCons(void)
info.usage = USB_USAGE_GENERIC_GAMEPAD;
info.manufacturer_string = L"Nintendo";
info.product_string = L"Switch Joy-Con (L/R)";
+ if (children[0]->is_bluetooth || children[1]->is_bluetooth) {
+ info.bus_type = SDL_HID_API_BUS_BLUETOOTH;
+ } else {
+ info.bus_type = SDL_HID_API_BUS_USB;
+ }
combined = HIDAPI_AddDevice(&info, 2, children);
if (combined && combined->driver) {