Fixed rumble for third-party Nintento Switch Pro controllers
authorSam Lantinga <slouken@libsdl.org>
Wed, 04 Mar 2020 17:10:37 -0800
changeset 13589ed4d8114b4e8
parent 13588 668a74d2aec1
child 13590 0311c59d15f9
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.
src/joystick/hidapi/SDL_hidapi_switch.c
     1.1 --- a/src/joystick/hidapi/SDL_hidapi_switch.c	Wed Mar 04 14:59:44 2020 -0800
     1.2 +++ b/src/joystick/hidapi/SDL_hidapi_switch.c	Wed Mar 04 17:10:37 2020 -0800
     1.3 @@ -455,7 +455,7 @@
     1.4  
     1.5      /* Refresh the rumble state periodically */
     1.6      if (ctx->m_bRumbleActive) {
     1.7 -        ctx->m_unRumbleRefresh = SDL_GetTicks() + 1000;
     1.8 +        ctx->m_unRumbleRefresh = SDL_GetTicks() + 30;
     1.9          if (!ctx->m_unRumbleRefresh) {
    1.10              ctx->m_unRumbleRefresh = 1;
    1.11          }