Skip to content

Commit

Permalink
Ignore key-release keyboard events (helix-editor#6139)
Browse files Browse the repository at this point in the history
Since crossterm 0.26.x, we receive press/release keyboard events on
Windows always. We can ignore the release events though to emulate
the behavior of keyboard input on Windows on crossterm 0.25.x.
  • Loading branch information
the-mikedavis authored and estin committed Mar 4, 2023
1 parent a7de387 commit 1a0b6c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions helix-term/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,11 @@ impl Application {
self.compositor
.handle_event(&Event::Resize(width, height), &mut cx)
}
// Ignore keyboard release events.
CrosstermEvent::Key(crossterm::event::KeyEvent {
kind: crossterm::event::KeyEventKind::Release,
..
}) => false,
event => self.compositor.handle_event(&event.into(), &mut cx),
};

Expand Down

0 comments on commit 1a0b6c7

Please sign in to comment.