mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-02 00:13:30 +02:00
Don't listen on keys with modifiers
This commit is contained in:
@@ -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 => (),
|
||||
|
||||
Reference in New Issue
Block a user