mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
fix tui to ignore key release event (#6057)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -315,17 +315,21 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
match event {
|
match event {
|
||||||
Event::Key(key) => match key.code {
|
Event::Key(key) => {
|
||||||
KeyCode::Char('q') | KeyCode::Char('Q') => return Ok(true),
|
if key.kind == event::KeyEventKind::Press {
|
||||||
KeyCode::Down => app.next(),
|
match key.code {
|
||||||
KeyCode::Up => app.previous(),
|
KeyCode::Char('q') | KeyCode::Char('Q') => return Ok(true),
|
||||||
KeyCode::Right => app.next_page(),
|
KeyCode::Down => app.next(),
|
||||||
KeyCode::Left => app.previous_page(),
|
KeyCode::Up => app.previous(),
|
||||||
KeyCode::Char('G') => {
|
KeyCode::Right => app.next_page(),
|
||||||
app.mode = ViewMode::GoToPage;
|
KeyCode::Left => app.previous_page(),
|
||||||
|
KeyCode::Char('G') => {
|
||||||
|
app.mode = ViewMode::GoToPage;
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
}
|
||||||
},
|
|
||||||
Event::Mouse(e) => match e.kind {
|
Event::Mouse(e) => match e.kind {
|
||||||
MouseEventKind::ScrollDown => app.next(),
|
MouseEventKind::ScrollDown => app.next(),
|
||||||
MouseEventKind::ScrollUp => app.previous(),
|
MouseEventKind::ScrollUp => app.previous(),
|
||||||
|
|||||||
Reference in New Issue
Block a user