Skip to content

Commit

Permalink
fix tui to ignore key release event (paradigmxyz#6057)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Seitz <[email protected]>
  • Loading branch information
hananbeer and mattsse authored Jan 14, 2024
1 parent 5127d40 commit 220a271
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions bin/reth/src/commands/db/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,17 +315,21 @@ where
}

match event {
Event::Key(key) => match key.code {
KeyCode::Char('q') | KeyCode::Char('Q') => return Ok(true),
KeyCode::Down => app.next(),
KeyCode::Up => app.previous(),
KeyCode::Right => app.next_page(),
KeyCode::Left => app.previous_page(),
KeyCode::Char('G') => {
app.mode = ViewMode::GoToPage;
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(),
KeyCode::Right => app.next_page(),
KeyCode::Left => app.previous_page(),
KeyCode::Char('G') => {
app.mode = ViewMode::GoToPage;
}
_ => {}
}
}
_ => {}
},
}
Event::Mouse(e) => match e.kind {
MouseEventKind::ScrollDown => app.next(),
MouseEventKind::ScrollUp => app.previous(),
Expand Down

0 comments on commit 220a271

Please sign in to comment.