Enum KeyCode
pub enum KeyCode {
Show 18 variants
Char(String),
Enter,
Escape,
Tab,
Backspace,
Delete,
Insert,
Up,
Down,
Left,
Right,
Home,
End,
PageUp,
PageDown,
F(u8),
Modifier(ModifierKeyCode),
Unknown,
}Expand description
Logical key pressed, mirroring the shape of crossterm::event::KeyCode.
Adjacently tagged so a key kind added in a later protocol minor version
decodes to KeyCode::Unknown instead of failing the whole frame.
Variants§
Char(String)
The composed character(s) produced by a single keypress.
Enter
The Enter / Return key.
Escape
The Escape key.
Tab
The Tab key.
Backspace
The Backspace key.
Delete
The Delete key.
Insert
The Insert key.
Up
The Up arrow key.
Down
The Down arrow key.
Left
The Left arrow key.
Right
The Right arrow key.
Home
The Home key.
End
The End key.
PageUp
The Page Up key.
PageDown
The Page Down key.
F(u8)
A function key; the payload is the n in Fn.
Modifier(ModifierKeyCode)
A modifier key pressed on its own, distinguishing left from right.
Unknown
A key not defined in this protocol minor version.
Trait Implementations§
§impl<'de> Deserialize<'de> for KeyCode
impl<'de> Deserialize<'de> for KeyCode
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for KeyCode
impl StructuralPartialEq for KeyCode
Auto Trait Implementations§
impl Freeze for KeyCode
impl RefUnwindSafe for KeyCode
impl Send for KeyCode
impl Sync for KeyCode
impl Unpin for KeyCode
impl UnsafeUnpin for KeyCode
impl UnwindSafe for KeyCode
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