diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-04-29 10:43:22 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-04-29 10:43:22 -0400 |
commit | e99f25b7d1e6c55fbfc59c6654f00de68e7c96ea (patch) | |
tree | 00c0fa7bea99f942016a3a7db29135a5a5e98262 /src/util/event.rs | |
parent | 3fa40b654a96df76f445da7da3a35bce69730ca8 (diff) |
fix issue with text paste not working in textfield
Diffstat (limited to 'src/util/event.rs')
-rw-r--r-- | src/util/event.rs | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/util/event.rs b/src/util/event.rs index 895dc56..ea68263 100644 --- a/src/util/event.rs +++ b/src/util/event.rs @@ -42,26 +42,23 @@ impl Events { { let event_tx = event_tx.clone(); thread::spawn(move || { - { - let stdin = io::stdin(); - let mut keys = stdin.keys(); - match keys.next() { - Some(key) => match key { - Ok(key) => { - if let Err(e) = event_tx.send(Event::Input(key)) { - eprintln!("Input thread send err: {:#?}", e); - return; - } + let stdin = io::stdin(); + let mut keys = stdin.keys(); + match keys.next() { + Some(key) => match key { + Ok(key) => { + if let Err(e) = event_tx.send(Event::Input(key)) { + eprintln!("Input thread send err: {:#?}", e); + return; } - _ => return, - }, + } _ => return, - } + }, + _ => return, } while let Ok(_) = input_rx.recv() { let stdin = io::stdin(); - let mut keys = stdin.keys(); if let Some(key) = keys.next() { if let Ok(key) = key { if let Err(e) = event_tx.send(Event::Input(key)) { |