Unnamed repository; edit this file 'description' to name the repository.
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.
Michael Davis 2023-03-01
parent 8dab8a0 · commit 27211ab
-rw-r--r--helix-term/src/application.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index d7896419..ee2a438c 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -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),
};