pub struct Keymap { /* private fields */ }Expand description
Input state for character autocorrect, word autoconvert, and host word shortcuts.
Implementations§
Source§impl Keymap
impl Keymap
Sourcepub fn define_word(&mut self, word: impl Into<String>, commands: Vec<Command>)
pub fn define_word(&mut self, word: impl Into<String>, commands: Vec<Command>)
Register a user word shortcut so word plus space expands to commands.
Sourcepub fn undefine_word(&mut self, word: &str)
pub fn undefine_word(&mut self, word: &str)
Remove a previously registered word shortcut while leaving built ins unaffected.
Sourcepub fn entries(&self) -> Vec<KeymapEntry<'_>>
pub fn entries(&self) -> Vec<KeymapEntry<'_>>
Return words the keymap can expand for a \ command popover.
Sourcepub fn map_key(&mut self, input: &KeyInput) -> Vec<Command>
pub fn map_key(&mut self, input: &KeyInput) -> Vec<Command>
Translate a key event into zero or more editor commands.
Trait Implementations§
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