Skip to content

Commit

Permalink
fix: closes #36 Double key strokes on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed May 24, 2024
1 parent c1be658 commit 9b7d575
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,12 @@ impl Ui {
if crossterm::event::poll(self.input_poll_rate).unwrap_or(false) {
if let Ok(event) = event::read() {
if let Event::Key(key) = event {
self.input_tx
.send(InputMessages::ButtonPress((key.code, key.modifiers)))
.await
.ok();
if key.kind == event::KeyEventKind::Press {
self.input_tx
.send(InputMessages::ButtonPress((key.code, key.modifiers)))
.await
.ok();
}
} else if let Event::Mouse(m) = event {
match m.kind {
event::MouseEventKind::Down(_)
Expand Down

0 comments on commit 9b7d575

Please sign in to comment.