pub struct KeyChordHandler { /* private fields */ }
Expand description
Manages key chord sequences and history
Implementations§
Source§impl KeyChordHandler
impl KeyChordHandler
pub fn new() -> Self
Sourcepub fn register_chord_action(&mut self, notation: &str, action: Action)
pub fn register_chord_action(&mut self, notation: &str, action: Action)
Register a chord sequence with an Action
Sourcepub fn process_key(&mut self, key: KeyEvent) -> ChordResult
pub fn process_key(&mut self, key: KeyEvent) -> ChordResult
Process a key event
Sourcepub fn cancel_chord(&mut self)
pub fn cancel_chord(&mut self)
Cancel current chord
Sourcepub fn log_key_press(&mut self, key: &KeyEvent)
pub fn log_key_press(&mut self, key: &KeyEvent)
Log a key press to history
Sourcepub fn get_history(&self) -> &[String]
pub fn get_history(&self) -> &[String]
Get the key press history
Sourcepub fn clear_history(&mut self)
pub fn clear_history(&mut self)
Clear the key press history
Sourcepub fn is_chord_mode_active(&self) -> bool
pub fn is_chord_mode_active(&self) -> bool
Get current chord mode status
Sourcepub fn get_chord_mode_description(&self) -> Option<&str>
pub fn get_chord_mode_description(&self) -> Option<&str>
Get chord mode description
Sourcepub fn set_timeout(&mut self, millis: u64)
pub fn set_timeout(&mut self, millis: u64)
Set chord timeout
Sourcepub fn format_debug_info(&self) -> String
pub fn format_debug_info(&self) -> String
Pretty print for debug view
Sourcepub fn load_from_config(&mut self, _config: &HashMap<String, String>)
pub fn load_from_config(&mut self, _config: &HashMap<String, String>)
Load custom bindings from config (for future) Note: This will need to be updated to work with Actions when config support is added
Auto Trait Implementations§
impl Freeze for KeyChordHandler
impl RefUnwindSafe for KeyChordHandler
impl Send for KeyChordHandler
impl Sync for KeyChordHandler
impl Unpin for KeyChordHandler
impl UnwindSafe for KeyChordHandler
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