소스 검색

Added note about trigger rumble availability across third-party Xbox One controllers

Sam Lantinga 2 년 전
부모
커밋
9d1dbd2ad8
1개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 10 1
      src/joystick/hidapi/SDL_hidapi_xboxone.c

+ 10 - 1
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