Skip to content

Commit

Permalink
Merge pull request #14 from wadackel/fix/windows-key-stroke
Browse files Browse the repository at this point in the history
fix: fixes bug where keys are pressed twice on windows
  • Loading branch information
wadackel authored Jan 14, 2024
2 parents 77b2347 + 4b05d9a commit eb27e48
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 eb27e48

Please sign in to comment.