Skip to content

Commit

Permalink
fix: fixes bug where keys are pressed twice on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wadackel committed Jan 14, 2024
1 parent 77b2347 commit 4b05d9a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,15 @@ impl<T: std::io::Write> Terminal<T> for Term<T> {
fn read_key(&mut self) -> Result<(KeyCode, KeyModifiers), Error> {
loop {
if let Event::Key(KeyEvent {
code, modifiers, ..
code,
modifiers,
kind,
..
}) = event::read()?
{
return Ok((code, modifiers));
if kind == event::KeyEventKind::Press {
return Ok((code, modifiers));
}
}
}
}
Expand Down

0 comments on commit 4b05d9a

Please sign in to comment.