Don't listen on keys with modifiers

This commit is contained in:
mo8it
2024-04-11 15:08:46 +02:00
parent 2e1a87d7d3
commit e79bc727f0
2 changed files with 16 additions and 6 deletions
+5 -1
View File
@@ -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 => (),