pub enum Key {
Char(char),
Backspace,
MoveLeft,
MoveRight,
WordLeft,
WordRight,
LineStart,
LineEnd,
Reset,
}Expand description
One unit of input fed to the Buffer by the platform capture layer.
Variants§
Char(char)
A printable character was typed.
Backspace
The Backspace key — delete the character before the caret.
MoveLeft
Left arrow — move the caret left by one character within the buffer. Buffer contents are unchanged.
MoveRight
Right arrow — move the caret right by one character within the buffer.
WordLeft
Ctrl+Left (word-jump) — move the caret to the start of the
previous word (or the start of the current word if the caret
sits inside one).
WordRight
Ctrl+Right — move the caret past the end of the next word
(or the end of the current word if the caret sits inside one).
LineStart
Home — move the caret to the start of the buffer. (The
daemon’s buffer holds at most one line — Enter still
resets — so “line start” and “buffer start” coincide.)
LineEnd
End — move the caret to the end of the buffer.
Reset
Anything we can’t track precisely: Up/Down/Tab/Enter/Esc, Page Up/Down, focus change, mouse click, or any Ctrl/Alt/ Super shortcut we haven’t taught the buffer about. After one of these the buffer’s contents and caret are no longer trustworthy, so the buffer clears itself.
Trait Implementations§
impl Copy for Key
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.