#[non_exhaustive]pub enum Key {
Show 25 variants
Escape,
Enter,
Tab,
Backspace,
Insert,
Delete,
Left,
Right,
Up,
Down,
PageUp,
PageDown,
Home,
End,
CapsLock,
ScrollLock,
NumLock,
PrintScreen,
Pause,
Menu,
KeypadBegin,
F(u8),
Media(MediaKey),
Mod(ModifierKey),
Char(char),
}
Expand description
A key.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Escape
Enter
Tab
Backspace
Insert
Delete
Left
Right
Up
Down
PageUp
PageDown
Home
End
CapsLock
ScrollLock
NumLock
PrintScreen
Pause
Menu
KeypadBegin
F(u8)
Media(MediaKey)
Mod(ModifierKey)
Char(char)
Implementations§
Source§impl Key
impl Key
Sourcepub fn with_ss3(byte: u8) -> Option<Self>
pub fn with_ss3(byte: u8) -> Option<Self>
Get the key corresponding to SS3/CSI-1 and the given byte.
Sourcepub fn with_function_key(code: u8) -> Option<Self>
pub fn with_function_key(code: u8) -> Option<Self>
Map a function key code to a key.
For a DECFNK escape sequence, that is, CSI Pcode ; Pmod ~, this method maps the code parameter to a key.
Sourcepub fn with_csi_u(code: u16) -> Option<(Self, Modifiers)>
pub fn with_csi_u(code: u16) -> Option<(Self, Modifiers)>
Map the CSI/u key code to a key.
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 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
Mutably borrows from an owned value. Read more