Struct gpui2::KeystrokeMatcher
source · pub struct KeystrokeMatcher { /* private fields */ }
Implementations§
source§impl KeystrokeMatcher
impl KeystrokeMatcher
pub fn new(keymap: Arc<Mutex<Keymap>>) -> Self
pub fn clear_pending(&mut self)
pub fn has_pending_keystrokes(&self) -> bool
sourcepub fn match_keystroke(
&mut self,
keystroke: &Keystroke,
context_stack: &[KeyContext]
) -> KeyMatch
pub fn match_keystroke( &mut self, keystroke: &Keystroke, context_stack: &[KeyContext] ) -> KeyMatch
Pushes a keystroke onto the matcher. The result of the new keystroke is returned: KeyMatch::None => No match is valid for this key given any pending keystrokes. KeyMatch::Pending => There exist bindings which are still waiting for more keys. KeyMatch::Complete(matches) => One or more bindings have received the necessary key presses. Bindings added later will take precedence over earlier bindings.
pub fn keystrokes_for_action( &self, action: &dyn Action, contexts: &[KeyContext] ) -> Option<SmallVec<[Keystroke; 2]>>
Auto Trait Implementations§
impl !RefUnwindSafe for KeystrokeMatcher
impl !Send for KeystrokeMatcher
impl !Sync for KeystrokeMatcher
impl Unpin for KeystrokeMatcher
impl !UnwindSafe for KeystrokeMatcher
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