pub struct KeySequenceRenderer { /* private fields */ }
Expand description
Smart key sequence renderer that:
- Collapses repeated keys (jjj -> 3j)
- Limits display to last N sequences
- Shows chord completions
- Handles timeout/fading
Implementations§
Source§impl KeySequenceRenderer
impl KeySequenceRenderer
pub fn new() -> Self
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable or disable the renderer
Sourcepub fn record_key(&mut self, key: String)
pub fn record_key(&mut self, key: String)
Record a key press
Sourcepub fn set_chord_mode(&mut self, description: Option<String>)
pub fn set_chord_mode(&mut self, description: Option<String>)
Set chord mode with available completions
Sourcepub fn clear_chord_mode(&mut self)
pub fn clear_chord_mode(&mut self)
Clear chord mode
Sourcepub fn get_display(&self) -> String
pub fn get_display(&self) -> String
Get the display string for the status line
Sourcepub fn has_content(&self) -> bool
pub fn has_content(&self) -> bool
Check if there’s anything to display
Sourcepub fn configure(
&mut self,
max_display: Option<usize>,
collapse_window_ms: Option<u64>,
fade_duration_ms: Option<u64>,
)
pub fn configure( &mut self, max_display: Option<usize>, collapse_window_ms: Option<u64>, fade_duration_ms: Option<u64>, )
Configure display parameters
pub fn is_enabled(&self) -> bool
pub fn get_chord_mode(&self) -> &Option<String>
pub fn sequence_count(&self) -> usize
pub fn get_sequences(&self) -> Vec<(String, usize)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeySequenceRenderer
impl RefUnwindSafe for KeySequenceRenderer
impl Send for KeySequenceRenderer
impl Sync for KeySequenceRenderer
impl Unpin for KeySequenceRenderer
impl UnwindSafe for KeySequenceRenderer
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