diff options
| author | lukeflo | 2024-10-11 14:27:21 +0200 |
|---|---|---|
| committer | lukeflo | 2024-10-12 22:41:38 +0200 |
| commit | 2fa5f8193c2cf3b75f54a37f0f7c4b5ae9d7d665 (patch) | |
| tree | 483b113616c9a750f618c45ca332858d63758a9f /src/frontend/handler.rs | |
| parent | 8e4bcaada27a50a83dba35deea8ad804d4bb226a (diff) | |
| parent | d9ed8fc8eaab1aa04aac031cc629d7018d513ab7 (diff) | |
| download | bibiman-2fa5f8193c2cf3b75f54a37f0f7c4b5ae9d7d665.tar.gz bibiman-2fa5f8193c2cf3b75f54a37f0f7c4b5ae9d7d665.zip | |
Merge branch 'scrollbar'
Diffstat (limited to 'src/frontend/handler.rs')
| -rw-r--r-- | src/frontend/handler.rs | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/src/frontend/handler.rs b/src/frontend/handler.rs index 9a27b3a..c2cacf5 100644 --- a/src/frontend/handler.rs +++ b/src/frontend/handler.rs @@ -48,12 +48,26 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App, tui: &mut Tui) -> R match app.current_area { // Keycodes for the tag area CurrentArea::TagArea => match key_event.code { - KeyCode::Char('j') | KeyCode::Down => { + KeyCode::Down => { app.select_next_tag(); } - KeyCode::Char('k') | KeyCode::Up => { + KeyCode::Up => { app.select_previous_tag(); } + KeyCode::Char('j') => { + if key_event.modifiers == KeyModifiers::ALT { + app.scroll_info_down(); + } else { + app.select_next_tag(); + } + } + KeyCode::Char('k') => { + if key_event.modifiers == KeyModifiers::ALT { + app.scroll_info_up(); + } else { + app.select_previous_tag(); + } + } KeyCode::Char('g') | KeyCode::Home => { app.select_first_tag(); } @@ -81,12 +95,26 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App, tui: &mut Tui) -> R }, // Keycodes for the entry area CurrentArea::EntryArea => match key_event.code { - KeyCode::Char('j') | KeyCode::Down => { + KeyCode::Down => { app.select_next_entry(); } - KeyCode::Char('k') | KeyCode::Up => { + KeyCode::Up => { app.select_previous_entry(); } + KeyCode::Char('j') => { + if key_event.modifiers == KeyModifiers::ALT { + app.scroll_info_down(); + } else { + app.select_next_entry(); + } + } + KeyCode::Char('k') => { + if key_event.modifiers == KeyModifiers::ALT { + app.scroll_info_up(); + } else { + app.select_previous_entry(); + } + } KeyCode::Char('g') | KeyCode::Home => { app.select_first_entry(); } @@ -148,6 +176,7 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App, tui: &mut Tui) -> R } _ => {} }, + CurrentArea::InfoArea => {} } Ok(()) } |
