feat: Support alternative keymappings for all keys, featuring hjkl movements
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
use crate::app::key_binding::DEFAULT_KEYBINDINGS;
|
||||
use crate::handlers::radarr_handlers::blocklist::BlocklistHandler;
|
||||
use crate::handlers::radarr_handlers::collections::CollectionsHandler;
|
||||
use crate::handlers::radarr_handlers::downloads::DownloadsHandler;
|
||||
@@ -8,7 +7,7 @@ use crate::handlers::radarr_handlers::root_folders::RootFoldersHandler;
|
||||
use crate::handlers::radarr_handlers::system::SystemHandler;
|
||||
use crate::handlers::KeyEventHandler;
|
||||
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
||||
use crate::{App, Key};
|
||||
use crate::{matches_key, App, Key};
|
||||
|
||||
mod blocklist;
|
||||
mod collections;
|
||||
@@ -65,6 +64,10 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for RadarrHandler<'a, 'b
|
||||
true
|
||||
}
|
||||
|
||||
fn ignore_alt_navigation(&self) -> bool {
|
||||
self.app.should_ignore_quit_key
|
||||
}
|
||||
|
||||
fn new(
|
||||
key: Key,
|
||||
app: &'a mut App<'b>,
|
||||
@@ -109,11 +112,11 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for RadarrHandler<'a, 'b
|
||||
pub fn handle_change_tab_left_right_keys(app: &mut App<'_>, key: Key) {
|
||||
let key_ref = key;
|
||||
match key_ref {
|
||||
_ if key == DEFAULT_KEYBINDINGS.left.key => {
|
||||
_ if matches_key!(left, key, app.should_ignore_quit_key) => {
|
||||
app.data.radarr_data.main_tabs.previous();
|
||||
app.pop_and_push_navigation_stack(app.data.radarr_data.main_tabs.get_active_route());
|
||||
}
|
||||
_ if key == DEFAULT_KEYBINDINGS.right.key => {
|
||||
_ if matches_key!(right, key, app.should_ignore_quit_key) => {
|
||||
app.data.radarr_data.main_tabs.next();
|
||||
app.pop_and_push_navigation_stack(app.data.radarr_data.main_tabs.get_active_route());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user