diff options
| author | mo8it <mo8it@proton.me> | 2024-04-11 15:08:46 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-11 15:08:46 +0200 |
| commit | e79bc727f07bbe99092f30e66f4df845a2cd2ec5 (patch) | |
| tree | 1ab7815c27e4043b2111ffaf864c5f59b996734a /src/watch | |
| parent | 2e1a87d7d3671c82932eb63b38ba383ce1fc7d53 (diff) | |
Don't listen on keys with modifiers
Diffstat (limited to 'src/watch')
| -rw-r--r-- | src/watch/terminal_event.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/watch/terminal_event.rs b/src/watch/terminal_event.rs index 7c85b5b..faca8a2 100644 --- a/src/watch/terminal_event.rs +++ b/src/watch/terminal_event.rs @@ -1,4 +1,4 @@ -use crossterm::event::{self, Event, KeyCode, KeyEventKind}; +use crossterm::event::{self, Event, KeyCode, KeyEventKind, KeyModifiers}; use std::sync::mpsc::Sender; use super::WatchEvent; @@ -26,6 +26,10 @@ pub fn terminal_event_handler(tx: Sender<WatchEvent>) { match terminal_event { Event::Key(key) => { + if key.modifiers != KeyModifiers::NONE { + continue; + } + match key.kind { KeyEventKind::Release => continue, KeyEventKind::Press | KeyEventKind::Repeat => (), |
