From 3c9559f765fad7de523f68a86c8048af1188dd5f Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 24 Jul 2021 19:43:56 -0700
Subject: [PATCH] Don't try to rumble third-party Nintendo Switch Pro
controllers
Sending rumble to the PowerA Spectra Nintendo Switch controller hangs input reports for a couple of seconds.
---
src/joystick/hidapi/SDL_hidapi_switch.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c
index 958a02949..68dcbfe10 100644
--- a/src/joystick/hidapi/SDL_hidapi_switch.c
+++ b/src/joystick/hidapi/SDL_hidapi_switch.c
@@ -1057,6 +1057,10 @@ HIDAPI_DriverSwitch_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joys
{
SDL_DriverSwitch_Context *ctx = (SDL_DriverSwitch_Context *)device->context;
+ if (ctx->m_bInputOnly) {
+ return SDL_Unsupported();
+ }
+
if (ctx->m_bRumblePending) {
if (HIDAPI_DriverSwitch_SendPendingRumble(ctx) < 0) {
return -1;