mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 08:47:18 +02:00
Add pause_stdin into event loop
This commit is contained in:
parent
211d34a784
commit
16f75edcfd
1 changed files with 5 additions and 0 deletions
|
@ -74,8 +74,13 @@ impl Events {
|
|||
let pause_stdin = Arc::new(Mutex::new(false));
|
||||
let _input_handle = {
|
||||
let tx = tx.clone();
|
||||
let pause_stdin = pause_stdin.clone();
|
||||
thread::spawn(move || {
|
||||
loop {
|
||||
if *pause_stdin.lock().unwrap() == true {
|
||||
thread::sleep(Duration::from_millis(250));
|
||||
continue;
|
||||
}
|
||||
// poll for tick rate duration, if no event, sent tick event.
|
||||
if let event::Event::Key(key) = event::read().unwrap() {
|
||||
let key = match key.code {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue