#[non_exhaustive]pub enum Key {
Show 77 variants
Backspace,
Enter,
Tab,
Escape,
Space,
Left,
Right,
Up,
Down,
Home,
End,
PageUp,
PageDown,
Delete,
Insert,
CapsLock,
ScrollLock,
NumLock,
PrintScreen,
Pause,
Menu,
Pad(KeyPad),
Mod(KeyMod),
Media(KeyMedia),
Fn(u8),
Char(char),
Dead(KeyDead),
A,
B,
C,
D,
E,
F,
G,
H,
I,
J,
K,
L,
M,
N,
O,
P,
Q,
R,
S,
T,
U,
V,
W,
X,
Y,
Z,
Digit1,
Digit2,
Digit3,
Digit4,
Digit5,
Digit6,
Digit7,
Digit8,
Digit9,
Digit0,
Backquote,
Minus,
Equal,
BracketLeft,
BracketRight,
Semicolon,
Quote,
Backslash,
IntlBackslash,
Comma,
Dot,
Slash,
Scancode(u16),
Unknown,
}event only.Variants (Non-exhaustive)ยง
This enum is marked as non-exhaustive
Backspace
Backspace key.
Enter
Enter key.
Tab
Tab key.
Escape
Escape key.
Space
Space bar 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.
Delete
Delete key.
Insert
Insert key.
CapsLock
Caps Lock key.
ScrollLock
Scroll Lock key.
NumLock
Num Lock key.
PrintScreen
Print Screen key.
Pause
Pause key.
Menu
Menu key.
Pad(KeyPad)
A keypad key.
Mod(KeyMod)
A modifer key.
Media(KeyMedia)
A multimedia key.
Fn(u8)
A function key.
- Normal: F1-F12
- +Shift: F13-F24
- +Control: F25-F36
- +Shift+Control: F37-F48
Char(char)
A Unicode character (text input, international layouts, fallback).
Dead(KeyDead)
A dead key (accent prefix, composition).
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Digit1
Digit2
Digit3
Digit4
Digit5
Digit6
Digit7
Digit8
Digit9
Digit0
Backquote
Physical key left of โ1โ
Minus
Physical - key.
Equal
Physical = key.
BracketLeft
Physical [ key.
BracketRight
Physical ] key.
Semicolon
Physical ; key.
Quote
Physical ' key.
Backslash
Physical \ key.
IntlBackslash
ISO-102 extra key.
Comma
Physical , key.
Dot
Physical . key.
Slash
Physical / key.
Scancode(u16)
Physical keys that have no universal name.
Unknown
Unknown key code (default).
Implementationsยง
Sourceยงimpl Key
Spanish-layout aliases for the US ANSI physical layout keys.
impl Key
Spanish-layout aliases for the US ANSI physical layout keys.
Each alias names the symbol normally appearing on Spanish keyboards in that physical position.
The listed characters reflect the typical unshifted and shifted outputs on standard ES layouts.
Sourcepub const EsApostrophe: Self = Self::Minus
pub const EsApostrophe: Self = Self::Minus
Spanish key for ' and ?.
Sourcepub const EsInvertedExclamationMark: Self = Self::Equal
pub const EsInvertedExclamationMark: Self = Self::Equal
Spanish key for ยก and ยฟ.
Sourcepub const EsBacktick: Self = Self::BracketLeft
pub const EsBacktick: Self = Self::BracketLeft
Spanish key for \`` and ^`.
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> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.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> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
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<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice only.