pub struct Keymap { /* private fields */ }Expand description
A collection of key bindings plus multi-keystroke matching state.
Implementations§
Source§impl Keymap
impl Keymap
pub fn new() -> Self
pub fn add(&mut self, binding: KeyBinding)
pub fn extend(&mut self, bindings: impl IntoIterator<Item = KeyBinding>)
pub fn bindings(&self) -> &[KeyBinding]
Sourcepub fn bindings_for(
&self,
action: &dyn Action,
) -> impl Iterator<Item = &KeyBinding>
pub fn bindings_for( &self, action: &dyn Action, ) -> impl Iterator<Item = &KeyBinding>
All bindings for a given action type (for showing shortcuts in menus).
pub fn has_pending(&self) -> bool
pub fn clear_pending(&mut self)
Sourcepub fn feed(
&mut self,
keystroke: &Keystroke,
contexts: &[&'static str],
) -> KeymapMatch
pub fn feed( &mut self, keystroke: &Keystroke, contexts: &[&'static str], ) -> KeymapMatch
Feeds a keystroke. contexts are the key contexts active on the
current focus path.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Keymap
impl !Send for Keymap
impl !Sync for Keymap
impl !UnwindSafe for Keymap
impl Freeze for Keymap
impl Unpin for Keymap
impl UnsafeUnpin 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