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::app::App;
|
||||
use crate::event::Key;
|
||||
use crate::handlers::{handle_prompt_toggle, KeyEventHandler};
|
||||
@@ -7,7 +6,7 @@ use crate::models::servarr_data::sonarr::sonarr_data::{ActiveSonarrBlock, EDIT_S
|
||||
use crate::models::sonarr_models::EditSeriesParams;
|
||||
use crate::models::Scrollable;
|
||||
use crate::network::sonarr_network::SonarrEvent;
|
||||
use crate::{handle_text_box_keys, handle_text_box_left_right_keys};
|
||||
use crate::{handle_text_box_keys, handle_text_box_left_right_keys, matches_key};
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "edit_series_handler_tests.rs"]
|
||||
@@ -83,6 +82,10 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveSonarrBlock> for EditSeriesHandler<'a
|
||||
EDIT_SERIES_BLOCKS.contains(&active_block)
|
||||
}
|
||||
|
||||
fn ignore_alt_navigation(&self) -> bool {
|
||||
self.app.should_ignore_quit_key
|
||||
}
|
||||
|
||||
fn new(
|
||||
key: Key,
|
||||
app: &'a mut App<'b>,
|
||||
@@ -450,7 +453,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveSonarrBlock> for EditSeriesHandler<'a
|
||||
ActiveSonarrBlock::EditSeriesPrompt => {
|
||||
if self.app.data.sonarr_data.selected_block.get_active_block()
|
||||
== ActiveSonarrBlock::EditSeriesConfirmPrompt
|
||||
&& key == DEFAULT_KEYBINDINGS.confirm.key
|
||||
&& matches_key!(confirm, key)
|
||||
{
|
||||
self.app.data.sonarr_data.prompt_confirm = true;
|
||||
self.app.data.sonarr_data.prompt_confirm_action =
|
||||
|
||||
Reference in New Issue
Block a user