From 9d1dbd2ad86805c316cf4f2ee8ab2b361be18f4d Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 6 Nov 2022 01:16:52 -0800
Subject: [PATCH] Added note about trigger rumble availability across
third-party Xbox One controllers
---
src/joystick/hidapi/SDL_hidapi_xboxone.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/joystick/hidapi/SDL_hidapi_xboxone.c b/src/joystick/hidapi/SDL_hidapi_xboxone.c
index ea1a5bc5f5ad..1a5798e911c8 100644
--- a/src/joystick/hidapi/SDL_hidapi_xboxone.c
+++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c
@@ -153,7 +153,16 @@ static SDL_bool
ControllerHasTriggerRumble(Uint16 vendor_id, Uint16 product_id)
{
/* All the Microsoft Xbox One controllers have trigger rumble */
- return (vendor_id == USB_VENDOR_MICROSOFT);
+ if (vendor_id == USB_VENDOR_MICROSOFT) {
+ return SDL_TRUE;
+ }
+
+ /* It turns out other controllers a mixed bag as to whether they support
+ trigger rumble or not, and when they do it's often a buzz rather than
+ the vibration of the Microsoft trigger rumble, so for now just pretend
+ that it is not available.
+ */
+ return SDL_FALSE;
}
static SDL_bool