Ignore key-release keyboard events (#6139)
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.
commit27211abf0688794f9bf7a395a8c47846b4f7fd41
authorMichael Davis <mcarsondavis@gmail.com>
dateTue 28 Feb 2023, 19:26 (4 years ago)
parent8dab8a0
helix-term/src/application.rs+5
@@ -638,6 +638,11 @@ impl Application {
638638 self.compositor
639639 .handle_event(&Event::Resize(width, height), &mut cx)
640640 }
641+ // Ignore keyboard release events.
642+ CrosstermEvent::Key(crossterm::event::KeyEvent {
643+ kind: crossterm::event::KeyEventKind::Release,
644+ ..
645+ }) => false,
641646 event => self.compositor.handle_event(&event.into(), &mut cx),
642647 };
643648