aboutsummaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/event.rs')
-rw-r--r--src/event.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/event.rs b/src/event.rs
index 81cf6bd..44a4c3e 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -19,12 +19,28 @@ pub fn handle_event(app: &mut App) -> io::Result<bool> {
return Ok(true);
}
}
+ crate::app::ViewState::AvailablePackages => {
+ if handle_available_packages_keybinds(key, app) {
+ return Ok(true);
+ }
+ }
}
}
Ok(false)
}
+fn handle_available_packages_keybinds(key: KeyEvent, app: &mut App<'_>) -> bool {
+ match key.code {
+ KeyCode::Char('q') => return true,
+ KeyCode::Tab => app.cycle_current_tab(),
+
+ _ => {}
+ }
+
+ false
+}
+
fn handle_search_keybinds(key: KeyEvent, app: &mut App) {
match key.code {
KeyCode::Esc => app.toggle_search_window(),