pub struct KeyMapper { /* private fields */ }
Expand description
Maps keyboard input to actions based on context
Implementations§
Source§impl KeyMapper
impl KeyMapper
pub fn new() -> Self
Sourcepub fn map_key(
&mut self,
key: KeyEvent,
context: &ActionContext,
) -> Option<Action>
pub fn map_key( &mut self, key: KeyEvent, context: &ActionContext, ) -> Option<Action>
Map a key event to an action based on current context
Sourcepub fn clear_pending(&mut self)
pub fn clear_pending(&mut self)
Clear any pending state (like count buffer and vim command buffer)
Sourcepub fn is_collecting_count(&self) -> bool
pub fn is_collecting_count(&self) -> bool
Check if we’re collecting a count
Sourcepub fn get_count_buffer(&self) -> &str
pub fn get_count_buffer(&self) -> &str
Get the current count buffer for display
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyMapper
impl RefUnwindSafe for KeyMapper
impl Send for KeyMapper
impl Sync for KeyMapper
impl Unpin for KeyMapper
impl UnwindSafe for KeyMapper
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more