pub struct KeyTableStack { /* private fields */ }Expand description
A stack of active key tables
Implementations§
Source§impl KeyTableStack
impl KeyTableStack
Sourcepub fn push(&mut self, activation: KeyTableActivation)
pub fn push(&mut self, activation: KeyTableActivation)
Push a new key table activation onto the stack
Sourcepub fn pop(&mut self) -> Option<KeyTableActivation>
pub fn pop(&mut self) -> Option<KeyTableActivation>
Pop the top key table from the stack
Sourcepub fn current(&self) -> Option<&KeyTableActivation>
pub fn current(&self) -> Option<&KeyTableActivation>
Get the current (top) key table activation
Sourcepub fn current_name(&self) -> &str
pub fn current_name(&self) -> &str
Get the name of the current key table, or “default” if stack is empty
Sourcepub fn resolve(&self, combo: &KeyCombo) -> Option<&KeyAction>
pub fn resolve(&self, combo: &KeyCombo) -> Option<&KeyAction>
Resolve a key combination by searching the stack from top to bottom
Returns the action if found, None otherwise
Sourcepub fn handle_key(&mut self, combo: KeyCombo, now: Instant) -> Option<KeyAction>
pub fn handle_key(&mut self, combo: KeyCombo, now: Instant) -> Option<KeyAction>
Handle a key press, resolving it and managing one-shot/timeout behavior
Returns the action if found, None otherwise
Sourcepub fn next_timeout(&self) -> Option<Instant>
pub fn next_timeout(&self) -> Option<Instant>
Check if any tables have timeouts and return the earliest timeout
Sourcepub fn default_table(&self) -> &KeyTable
pub fn default_table(&self) -> &KeyTable
Get a reference to the default table
Sourcepub fn default_table_mut(&mut self) -> &mut KeyTable
pub fn default_table_mut(&mut self) -> &mut KeyTable
Get a mutable reference to the default table
Trait Implementations§
Source§impl Clone for KeyTableStack
impl Clone for KeyTableStack
Source§fn clone(&self) -> KeyTableStack
fn clone(&self) -> KeyTableStack
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyTableStack
impl Debug for KeyTableStack
Auto Trait Implementations§
impl Freeze for KeyTableStack
impl RefUnwindSafe for KeyTableStack
impl Send for KeyTableStack
impl Sync for KeyTableStack
impl Unpin for KeyTableStack
impl UnsafeUnpin for KeyTableStack
impl UnwindSafe for KeyTableStack
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.