diff --git a/CHANGELOG.md b/CHANGELOG.md index cd7c74e09..1a7e20b69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Keyboard: fix system repeat rate as repeats per second rather then millisecond delay between repeats - Surface: fix panic in `compute_dpi_factor()` by only computing the dpi factor on surfaces known to the OutputMgr - Window: `set_title()` now requires a manual `refresh()` for the change to take effect diff --git a/src/keyboard/mod.rs b/src/keyboard/mod.rs index 07395e9cb..f296147d3 100644 --- a/src/keyboard/mod.rs +++ b/src/keyboard/mod.rs @@ -361,7 +361,7 @@ impl Drop for KbState { pub enum KeyRepeatKind { /// keys will be repeated at a set rate and delay Fixed { - /// rate (in milliseconds) at which the repetition should occur + /// the number of repetitions per second that should occur rate: u64, /// delay (in milliseconds) between a key press and the start of repetition delay: u64, @@ -729,7 +729,9 @@ where proxy.clone(), ); // Rate - thread::sleep(Duration::from_millis(repeat_timing.0)); + thread::sleep( + Duration::from_secs(1) / repeat_timing.0 as u32, + ); match thread_kill_chan.lock().unwrap().1.try_recv() { Ok(_) | Err(mpsc::TryRecvError::Disconnected) => { break