pub struct Keymap {
pub index: Vec<(KeyPattern, Function)>,
pub pager: Vec<(KeyPattern, PagerAction)>,
pub macros_index: Vec<(KeyPattern, Vec<KeyEvent>, String)>,
pub macros_pager: Vec<(KeyPattern, Vec<KeyEvent>, String)>,
}Fields§
§index: Vec<(KeyPattern, Function)>§pager: Vec<(KeyPattern, PagerAction)>§macros_index: Vec<(KeyPattern, Vec<KeyEvent>, String)>Macros: trigger → (replayed events, the sequence as written, kept for the help screen). Checked before the action bindings, so a macro shadows a binding on the same key (like mutt).
macros_pager: Vec<(KeyPattern, Vec<KeyEvent>, String)>Implementations§
Source§impl Keymap
impl Keymap
Sourcepub fn with_config(
index_over: &HashMap<String, String>,
pager_over: &HashMap<String, String>,
macros_index: &HashMap<String, String>,
macros_pager: &HashMap<String, String>,
) -> (Keymap, Vec<String>)
pub fn with_config( index_over: &HashMap<String, String>, pager_over: &HashMap<String, String>, macros_index: &HashMap<String, String>, macros_pager: &HashMap<String, String>, ) -> (Keymap, Vec<String>)
Defaults with config remaps applied: a remap unbinds the action’s
default keys and whatever the new key was bound to. Macros come
from [macros.index]/[macros.pager], key = "sequence".
Sourcepub fn lookup_index_macro(&self, key: &KeyEvent) -> Option<&[KeyEvent]>
pub fn lookup_index_macro(&self, key: &KeyEvent) -> Option<&[KeyEvent]>
The macro sequence bound to this key, if any.
pub fn lookup_pager_macro(&self, key: &KeyEvent) -> Option<&[KeyEvent]>
pub fn lookup_index(&self, key: &KeyEvent) -> Option<Function>
pub fn lookup_pager(&self, key: &KeyEvent) -> Option<PagerAction>
Sourcepub fn help_lines(&self) -> Vec<String>
pub fn help_lines(&self) -> Vec<String>
Lines for the help screen, grouped and ordered by action.
Auto Trait Implementations§
impl Freeze for Keymap
impl RefUnwindSafe for Keymap
impl Send for Keymap
impl Sync for Keymap
impl Unpin for Keymap
impl UnsafeUnpin for Keymap
impl UnwindSafe for Keymap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more