diff options
| author | LC <mathew1800@gmail.com> | 2021-01-23 10:46:18 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-23 10:46:18 -0500 |
| commit | fc6596ba6b5a317ab1eec4b8b16060c9f96d458f (patch) | |
| tree | 9524ecae015a27c0b5e1c42d2a83e14ace9fdf82 /src/input_common/sdl/sdl_impl.cpp | |
| parent | 964cd9e0f3909d35edb8f6344c266d11a5a51620 (diff) | |
| parent | 6b5e5ad224536b380bd4a2616fe3163117748c6b (diff) | |
Merge pull request #5800 from Morph1984/max-vibration-duration
sdl_impl: Set the maximum vibration duration to 1 second
Diffstat (limited to 'src/input_common/sdl/sdl_impl.cpp')
| -rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index d32eb732ab..1b5750937a 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -81,10 +81,14 @@ public: } bool RumblePlay(u16 amp_low, u16 amp_high) { + constexpr u32 rumble_max_duration_ms = 1000; + if (sdl_controller) { - return SDL_GameControllerRumble(sdl_controller.get(), amp_low, amp_high, 0) == 0; + return SDL_GameControllerRumble(sdl_controller.get(), amp_low, amp_high, + rumble_max_duration_ms) == 0; } else if (sdl_joystick) { - return SDL_JoystickRumble(sdl_joystick.get(), amp_low, amp_high, 0) == 0; + return SDL_JoystickRumble(sdl_joystick.get(), amp_low, amp_high, + rumble_max_duration_ms) == 0; } return false; |
