From 05fdfa157272f474d29d2fc01f8963e3265c4eaa Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 27 Jan 2026 13:51:16 -0800
Subject: [PATCH] Fixed hang sending output reports to the NVIDIA SHIELD
Controller on macOS
(cherry picked from commit 72343b9ee2cd70523cc12fcf7b93588837dd0c8e)
---
src/joystick/hidapi/SDL_hidapi_shield.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/joystick/hidapi/SDL_hidapi_shield.c b/src/joystick/hidapi/SDL_hidapi_shield.c
index a057a04865aaf..2b3df213cc092 100644
--- a/src/joystick/hidapi/SDL_hidapi_shield.c
+++ b/src/joystick/hidapi/SDL_hidapi_shield.c
@@ -29,7 +29,9 @@
#ifdef SDL_JOYSTICK_HIDAPI_SHIELD
// Define this if you want to log all packets from the controller
-// #define DEBUG_SHIELD_PROTOCOL
+#if 0
+#define DEBUG_SHIELD_PROTOCOL
+#endif
#define CMD_BATTERY_STATE 0x07
#define CMD_RUMBLE 0x39
@@ -138,6 +140,11 @@ static void HIDAPI_DriverShield_SetDevicePlayerIndex(SDL_HIDAPI_Device *device,
static bool HIDAPI_DriverShield_SendCommand(SDL_HIDAPI_Device *device, Uint8 cmd, const void *data, int size)
{
+#ifdef SDL_PLATFORM_MACOS
+ // We hang for several seconds when trying to send output reports on macOS
+ return SDL_Unsupported();
+
+#else
SDL_DriverShield_Context *ctx = (SDL_DriverShield_Context *)device->context;
ShieldCommandReport_t cmd_pkt;
@@ -166,6 +173,8 @@ static bool HIDAPI_DriverShield_SendCommand(SDL_HIDAPI_Device *device, Uint8 cmd
}
return true;
+
+#endif // MACOS
}
static bool HIDAPI_DriverShield_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)