Browse Source

Merge pull request #5800 from Morph1984/max-vibration-duration

sdl_impl: Set the maximum vibration duration to 1 second
pull/15/merge
LC 5 years ago
committed by GitHub
parent
commit
bfd2bcb068
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/input_common/sdl/sdl_impl.cpp

8
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;

Loading…
Cancel
Save