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.
This commit is contained in:
Michael Davis 2023-02-28 19:26:02 -06:00 committed by GitHub
parent 8dab8a0a03
commit 27211abf06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -638,6 +638,11 @@ pub async fn handle_terminal_events(
self.compositor self.compositor
.handle_event(&Event::Resize(width, height), &mut cx) .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), event => self.compositor.handle_event(&event.into(), &mut cx),
}; };