#[non_exhaustive]pub enum KeyCode {
Show 24 variants
Char(char),
F(u8),
Backspace,
Enter,
Left,
Right,
Up,
Down,
Home,
End,
PageUp,
PageDown,
Tab,
BackTab,
Delete,
Insert,
Escape,
Modifier(ModifierKey),
CapsLock,
ScrollLock,
NumLock,
PrintScreen,
Pause,
Menu,
}Expand description
Keyboard key codes.
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.
Char(char)
A character key.
F(u8)
A function key.
Backspace
Backspace.
Enter
Enter.
Left
Left arrow.
Right
Right arrow.
Up
Up arrow.
Down
Down arrow.
Home
Home.
End
End.
PageUp
Page Up.
PageDown
Page Down.
Tab
Tab.
BackTab
Backtab.
Delete
Delete.
Insert
Insert.
Escape
Escape.
Modifier(ModifierKey)
A modifier key pressed on its own, without another key. See ModifierKey for the
backend-availability caveat.
CapsLock
Caps Lock.
ScrollLock
Scroll Lock.
NumLock
Num Lock.
PrintScreen
Print Screen.
Pause
Pause.
Menu
Menu (context menu key).
Trait Implementations§
impl Copy for KeyCode
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