pub enum KeyKind {
Char(char),
Special(SpecialKey),
}Expand description
What kind of key the chord represents.
Char covers printable characters and Ctrl/Alt-modified chars
(the modifier lives in mods). For letters the case
encodes shift (vim convention: A is shift+a; we don’t carry
KeyMods::SHIFT for plain letters). For non-letter chars
($, 0, <, …) the case is the only valid form.
Special covers named keys (Esc, Enter, Tab, Up, …)
where shift IS carried separately because <S-Tab> is a
genuinely different chord from <Tab>.
Function keys live in Special::F(u8) rather than as their
own enum variant to keep the type compact; 1..=24 covers
every reasonable terminal.
Variants§
Char(char)
A character key: the character it produces (already shifted, so A
or $, never a+Shift or 4+Shift).
Special(SpecialKey)
A named, non-character key.
Trait Implementations§
impl Copy for KeyKind
impl Eq for KeyKind
impl StructuralPartialEq for KeyKind
Auto Trait Implementations§
impl Freeze for KeyKind
impl RefUnwindSafe for KeyKind
impl Send for KeyKind
impl Sync for KeyKind
impl Unpin for KeyKind
impl UnsafeUnpin for KeyKind
impl UnwindSafe for KeyKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.