pub struct Keybindings { /* private fields */ }Expand description
Keybindings manager.
Implementations§
Source§impl Keybindings
impl Keybindings
Sourcepub fn matches(&self, event: &KeyEvent, binding_id: KeybindingId) -> bool
pub fn matches(&self, event: &KeyEvent, binding_id: KeybindingId) -> bool
Check if a key event matches a keybinding.
Sourcepub fn get_binding(&self, event: &KeyEvent) -> Option<KeybindingId>
pub fn get_binding(&self, event: &KeyEvent) -> Option<KeybindingId>
Get the keybinding ID for a key event.
Sourcepub fn get_keys(&self, binding_id: KeybindingId) -> Vec<KeyCombo>
pub fn get_keys(&self, binding_id: KeybindingId) -> Vec<KeyCombo>
Get keys for a keybinding.
Sourcepub fn get_definition(
&self,
binding_id: KeybindingId,
) -> Option<&KeybindingDefinition>
pub fn get_definition( &self, binding_id: KeybindingId, ) -> Option<&KeybindingDefinition>
Get definition for a keybinding.
Sourcepub fn get_conflicts(&self) -> &[KeybindingConflict]
pub fn get_conflicts(&self) -> &[KeybindingConflict]
Get conflicts.
Sourcepub fn set_user_bindings(
&mut self,
user_bindings: HashMap<KeybindingId, Vec<KeyCombo>>,
)
pub fn set_user_bindings( &mut self, user_bindings: HashMap<KeybindingId, Vec<KeyCombo>>, )
Set user bindings.
Sourcepub fn set(&mut self, binding_id: KeybindingId, combos: Vec<KeyCombo>)
pub fn set(&mut self, binding_id: KeybindingId, combos: Vec<KeyCombo>)
Set a single keybinding.
Trait Implementations§
Source§impl Clone for Keybindings
impl Clone for Keybindings
Auto Trait Implementations§
impl Freeze for Keybindings
impl RefUnwindSafe for Keybindings
impl Send for Keybindings
impl Sync for Keybindings
impl Unpin for Keybindings
impl UnsafeUnpin for Keybindings
impl UnwindSafe for Keybindings
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