admin panel keyindings
This commit is contained in:
@@ -28,6 +28,8 @@ pub struct ModeKeybindings {
|
||||
#[serde(default)]
|
||||
pub intro: HashMap<String, Vec<String>>,
|
||||
#[serde(default)]
|
||||
pub admin: HashMap<String, Vec<String>>,
|
||||
#[serde(default)]
|
||||
pub read_only: HashMap<String, Vec<String>>,
|
||||
#[serde(default)]
|
||||
pub edit: HashMap<String, Vec<String>>,
|
||||
@@ -58,9 +60,11 @@ impl Config {
|
||||
|
||||
/// Gets an action for a key in Admin mode, checking common and global bindings
|
||||
pub fn get_admin_action(&self, key: KeyCode, modifiers: KeyModifiers) -> Option<&str> {
|
||||
self.get_action_for_key_in_mode(&self.keybindings.common, key, modifiers)
|
||||
self.get_action_for_key_in_mode(&self.keybindings.admin, key, modifiers)
|
||||
.or_else(|| self.get_action_for_key_in_mode(&self.keybindings.common, key, modifiers))
|
||||
.or_else(|| self.get_action_for_key_in_mode(&self.keybindings.intro, key, modifiers))
|
||||
.or_else(|| self.get_action_for_key_in_mode(&self.keybindings.global, key, modifiers))
|
||||
}
|
||||
}
|
||||
|
||||
/// Gets an action for a key in Read-Only mode, also checking common keybindings.
|
||||
pub fn get_read_only_action_for_key(&self, key: KeyCode, modifiers: KeyModifiers) -> Option<&str> {
|
||||
|
||||
Reference in New Issue
Block a user