Skip to content

Commit

Permalink
Trying some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunakw committed Jul 31, 2022
1 parent 9981dab commit a3fdf81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ async fn start_keydown(state: State<'_, AppState>, millis: u64, key: Key) -> Res
if !*on.lock().await {
*on.lock().await = true;

rdev::simulate(&EventType::KeyPress(key)).unwrap();
let mut interval = time::interval(Duration::from_millis(millis));
while *on.lock().await {
interval.tick().await;
rdev::simulate(&EventType::KeyPress(key)).unwrap();
}
rdev::simulate(&EventType::KeyRelease(key)).unwrap();
}
Expand Down

0 comments on commit a3fdf81

Please sign in to comment.