diff --git a/src/sdl2/controller.rs b/src/sdl2/controller.rs index 393abe86353..38b8996014b 100644 --- a/src/sdl2/controller.rs +++ b/src/sdl2/controller.rs @@ -405,6 +405,15 @@ impl GameController { /// Set the rumble motors to their specified intensities, if supported. /// Automatically resets back to zero after `duration_ms` milliseconds have passed. + /// + /// # Notes + /// + /// The value range for the intensities is 0 to 0xFFFF. + /// + /// Do *not* use `std::u32::MAX` or similar for `duration_ms` if you want + /// the rumble effect to keep playing for a long time, as this results in + /// the effect ending immediately after starting due to an overflow. + /// Use some smaller, "huge enough" number instead. pub fn set_rumble(&mut self, low_frequency_rumble: u16, high_frequency_rumble: u16, diff --git a/src/sdl2/joystick.rs b/src/sdl2/joystick.rs index 61b2ef8e4c5..1c01bb87dfa 100644 --- a/src/sdl2/joystick.rs +++ b/src/sdl2/joystick.rs @@ -347,6 +347,15 @@ impl Joystick { /// Set the rumble motors to their specified intensities, if supported. /// Automatically resets back to zero after `duration_ms` milliseconds have passed. + /// + /// # Notes + /// + /// The value range for the intensities is 0 to 0xFFFF. + /// + /// Do *not* use `std::u32::MAX` or similar for `duration_ms` if you want + /// the rumble effect to keep playing for a long time, as this results in + /// the effect ending immediately after starting due to an overflow. + /// Use some smaller, "huge enough" number instead. pub fn set_rumble(&mut self, low_frequency_rumble: u16, high_frequency_rumble: u16,