Enum pc_keyboard::KeyCode
source · [−]#[non_exhaustive]
pub enum KeyCode {
Show 120 variants
AltLeft,
AltRight,
ArrowDown,
ArrowLeft,
ArrowRight,
ArrowUp,
BackSlash,
Backspace,
BackTick,
BracketSquareLeft,
BracketSquareRight,
Break,
CapsLock,
Comma,
ControlLeft,
ControlRight,
Delete,
End,
Enter,
Escape,
Equals,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
Fullstop,
Home,
Insert,
Key1,
Key2,
Key3,
Key4,
Key5,
Key6,
Key7,
Key8,
Key9,
Key0,
Menus,
Minus,
Numpad0,
Numpad1,
Numpad2,
Numpad3,
Numpad4,
Numpad5,
Numpad6,
Numpad7,
Numpad8,
Numpad9,
NumpadEnter,
NumpadLock,
NumpadSlash,
NumpadStar,
NumpadMinus,
NumpadPeriod,
NumpadPlus,
PageDown,
PageUp,
PauseBreak,
PrintScreen,
ScrollLock,
SemiColon,
ShiftLeft,
ShiftRight,
Slash,
Spacebar,
SysReq,
Tab,
Quote,
WindowsLeft,
WindowsRight,
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,
HashTilde,
PrevTrack,
NextTrack,
Mute,
Calculator,
Play,
Stop,
VolumeDown,
VolumeUp,
WWWHome,
PowerOnTestOk,
Oem102,
PrintScreen2,
TooManyKeys,
}
Expand description
Keycodes that can be generated by a keyboard.
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.
AltLeft
AltRight
ArrowDown
ArrowLeft
ArrowRight
ArrowUp
BackSlash
Backspace
BackTick
BracketSquareLeft
BracketSquareRight
Break
CapsLock
Comma
ControlLeft
ControlRight
Delete
End
Enter
Escape
Equals
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
Fullstop
Home
Insert
Key1
Key2
Key3
Key4
Key5
Key6
Key7
Key8
Key9
Key0
Menus
Minus
Numpad0
Numpad1
Numpad2
Numpad3
Numpad4
Numpad5
Numpad6
Numpad7
Numpad8
Numpad9
NumpadEnter
NumpadLock
NumpadSlash
NumpadStar
NumpadMinus
NumpadPeriod
NumpadPlus
PageDown
PageUp
PauseBreak
PrintScreen
ScrollLock
SemiColon
ShiftLeft
ShiftRight
Slash
Spacebar
SysReq
Tab
Quote
WindowsLeft
WindowsRight
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
HashTilde
The key to the left of the 102/105-key “Tall Return” Key - not on 101/104-key keyboards
PrevTrack
NextTrack
Mute
Calculator
Play
Stop
VolumeDown
VolumeUp
WWWHome
PowerOnTestOk
Sent when the keyboard boots
Oem102
Used for <>
on DE layouts
PrintScreen2
PrintScreen comes in two parts - this is the second
TooManyKeys
Sent by the keyboard when too many keys are pressed
Trait Implementations
sourceimpl Ord for KeyCode
impl Ord for KeyCode
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<KeyCode> for KeyCode
impl PartialOrd<KeyCode> for KeyCode
sourcefn partial_cmp(&self, other: &KeyCode) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyCode) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for KeyCode
impl Eq for KeyCode
impl StructuralEq for KeyCode
impl StructuralPartialEq for KeyCode
Auto Trait Implementations
impl RefUnwindSafe for KeyCode
impl Send for KeyCode
impl Sync for KeyCode
impl Unpin for KeyCode
impl UnwindSafe for KeyCode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more