autorepeat_fire_window

Function autorepeat_fire_window 

Source
pub fn autorepeat_fire_window(
    is_down: bool,
    elapsed_down_ms: u32,
    elapsed_since_last_fire_ms: u32,
    first_delay_ms: u32,
    repeat_rate_ms: u32,
    window_ms: u32,
) -> bool
Expand description

Autorepeat helper (jitter-tolerant): fire if the time since last fire crosses the next repeat boundary within a small window.

  • is_down: key/button held
  • elapsed_down_ms: time since became down
  • elapsed_since_last_fire_ms: time since the last generated fire (0 at initial down)
  • first_delay_ms: initial delay before repeating
  • repeat_rate_ms: cadence for subsequent fires
  • window_ms: allowed jitter window (e.g., 5~16ms)