fix tui to ignore key release event (#6057)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
high_byte
2024-01-14 12:54:26 +02:00
committed by GitHub
parent 5127d40f48
commit 220a2715e9

View File

@ -315,7 +315,9 @@ where
}
match event {
Event::Key(key) => match key.code {
Event::Key(key) => {
if key.kind == event::KeyEventKind::Press {
match key.code {
KeyCode::Char('q') | KeyCode::Char('Q') => return Ok(true),
KeyCode::Down => app.next(),
KeyCode::Up => app.previous(),
@ -325,7 +327,9 @@ where
app.mode = ViewMode::GoToPage;
}
_ => {}
},
}
}
}
Event::Mouse(e) => match e.kind {
MouseEventKind::ScrollDown => app.next(),
MouseEventKind::ScrollUp => app.previous(),