瀏覽代碼

Fixed rumble for third-party Nintento Switch Pro controllers

The 8BitDo SF30 Pro Gamepad will generate a single motor pulse for each rumble message, so we need to do this frequently to have continous rumble on this device.
Sam Lantinga 5 年之前
父節點
當前提交
e9bc21fba5
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/joystick/hidapi/SDL_hidapi_switch.c

+ 1 - 1
src/joystick/hidapi/SDL_hidapi_switch.c

@@ -455,7 +455,7 @@ static SDL_bool WriteRumble(SDL_DriverSwitch_Context *ctx)
 
 
     /* Refresh the rumble state periodically */
     /* Refresh the rumble state periodically */
     if (ctx->m_bRumbleActive) {
     if (ctx->m_bRumbleActive) {
-        ctx->m_unRumbleRefresh = SDL_GetTicks() + 1000;
+        ctx->m_unRumbleRefresh = SDL_GetTicks() + 30;
         if (!ctx->m_unRumbleRefresh) {
         if (!ctx->m_unRumbleRefresh) {
             ctx->m_unRumbleRefresh = 1;
             ctx->m_unRumbleRefresh = 1;
         }
         }