pub enum KeyCode {
Show 27 variants
Backspace,
Enter,
Left,
Right,
Up,
Down,
Home,
End,
PageUp,
PageDown,
Tab,
BackTab,
Delete,
Insert,
F(u8),
Char(char),
Null,
Esc,
CapsLock,
ScrollLock,
NumLock,
PrintScreen,
Pause,
Menu,
KeypadBegin,
Media(MediaKeyCode),
Modifier(ModifierKeyCode),
}Expand description
Represents a key.
Variants§
Backspace
Backspace key.
Enter
Enter key.
Left
Left arrow key.
Right
Right arrow key.
Up
Up arrow key.
Down
Down arrow key.
Home
Home key.
End
End key.
PageUp
Page up key.
PageDown
Page down key.
Tab
Tab key.
BackTab
Shift + Tab key.
Delete
Delete key.
Insert
Insert key.
F(u8)
F key.
KeyCode::F(1) represents F1 key, etc.
Char(char)
A character.
KeyCode::Char('c') represents c character, etc.
Null
Null.
Esc
Escape key.
CapsLock
Caps Lock key.
Note: this key can only be read if
KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES has been enabled with
PushKeyboardEnhancementFlags.
ScrollLock
Scroll Lock key.
Note: this key can only be read if
KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES has been enabled with
PushKeyboardEnhancementFlags.
NumLock
Num Lock key.
Note: this key can only be read if
KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES has been enabled with
PushKeyboardEnhancementFlags.
PrintScreen
Print Screen key.
Note: this key can only be read if
KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES has been enabled with
PushKeyboardEnhancementFlags.
Pause
Pause key.
Note: this key can only be read if
KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES has been enabled with
PushKeyboardEnhancementFlags.
Menu
Menu key.
Note: this key can only be read if
KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES has been enabled with
PushKeyboardEnhancementFlags.
KeypadBegin
The “Begin” key (often mapped to the 5 key when Num Lock is turned on).
Note: this key can only be read if
KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES has been enabled with
PushKeyboardEnhancementFlags.
Media(MediaKeyCode)
A media key.
Note: these keys can only be read if
KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES has been enabled with
PushKeyboardEnhancementFlags.
Modifier(ModifierKeyCode)
A modifier key.
Note: these keys can only be read if both
KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES and
KeyboardEnhancementFlags::REPORT_ALL_KEYS_AS_ESCAPE_CODES have been enabled with
PushKeyboardEnhancementFlags.
Trait Implementations§
Source§impl PartialOrd for KeyCode
impl PartialOrd for KeyCode
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 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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more