pub struct Keymap { /* private fields */ }Expand description
The resolved action→key table — KeymapAction::default_key for every
action, with any Self::with_overrides substitutions applied.
Implementations§
Source§impl Keymap
impl Keymap
Sourcepub fn with_overrides(overrides: &HashMap<String, String>) -> Keymap
pub fn with_overrides(overrides: &HashMap<String, String>) -> Keymap
Build a keymap from Config::tui_keymap-shaped
overrides (action name → key spec string, KeyEvent::parse
syntax). An unknown action name, or a key spec that fails to parse,
is silently skipped (keeps the default for that action) — a typo in
a user’s keymap table degrades to “unchanged”, never a startup
failure or a panic.
Sourcepub fn key_for(&self, action: KeymapAction) -> KeyEvent
pub fn key_for(&self, action: KeymapAction) -> KeyEvent
The key currently bound to action.
Sourcepub fn action_for(&self, key: KeyEvent) -> Option<KeymapAction>
pub fn action_for(&self, key: KeyEvent) -> Option<KeymapAction>
Which action (if any) key is bound to.
Trait Implementations§
impl Eq for Keymap
impl StructuralPartialEq for Keymap
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.