We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6f3353 commit aa4266cCopy full SHA for aa4266c
src/input.rs
@@ -1,7 +1,7 @@
1
use crate::notify_mutex::NotifyableMutex;
2
use anyhow::Result;
3
use crossbeam_channel::{unbounded, Receiver, Sender};
4
-use crossterm::event::{self, Event};
+use crossterm::event::{self, Event, Event::Key, KeyEventKind};
5
use std::{
6
sync::{
7
atomic::{AtomicBool, Ordering},
@@ -113,6 +113,12 @@ impl Input {
113
arc_current.store(true, Ordering::Relaxed);
114
115
if let Some(e) = Self::poll(POLL_DURATION)? {
116
+ // windows send key release too, only process key press
117
+ if let Key(key) = e {
118
+ if key.kind != KeyEventKind::Press {
119
+ continue;
120
+ }
121
122
tx.send(InputEvent::Input(e))?;
123
}
124
} else {
0 commit comments