Enum pc_keyboard::KeyCode
source · #[repr(u8)]
pub enum KeyCode {
Show 124 variants
Escape,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
PrintScreen,
SysRq,
ScrollLock,
PauseBreak,
Oem8,
Key1,
Key2,
Key3,
Key4,
Key5,
Key6,
Key7,
Key8,
Key9,
Key0,
OemMinus,
OemPlus,
Backspace,
Insert,
Home,
PageUp,
NumpadLock,
NumpadDivide,
NumpadMultiply,
NumpadSubtract,
Tab,
Q,
W,
E,
R,
T,
Y,
U,
I,
O,
P,
Oem4,
Oem6,
Oem5,
Oem7,
Delete,
End,
PageDown,
Numpad7,
Numpad8,
Numpad9,
NumpadAdd,
CapsLock,
A,
S,
D,
F,
G,
H,
J,
K,
L,
Oem1,
Oem3,
Return,
Numpad4,
Numpad5,
Numpad6,
LShift,
Z,
X,
C,
V,
B,
N,
M,
OemComma,
OemPeriod,
Oem2,
RShift,
ArrowUp,
Numpad1,
Numpad2,
Numpad3,
NumpadEnter,
LControl,
LWin,
LAlt,
Spacebar,
RAltGr,
RWin,
Apps,
RControl,
ArrowLeft,
ArrowDown,
ArrowRight,
Numpad0,
NumpadPeriod,
Oem9,
Oem10,
Oem11,
Oem12,
Oem13,
PrevTrack,
NextTrack,
Mute,
Calculator,
Play,
Stop,
VolumeDown,
VolumeUp,
WWWHome,
PowerOnTestOk,
TooManyKeys,
RControl2,
RAlt2,
}
Expand description
Keycodes that can be generated by a keyboard.
We use this enum to abstract over Scan Code Set 1 and Scan Code Set 2.
See https://kbdlayout.info/kbduk/shiftstates+virtualkeys/base
Variants§
Escape
Top Left of the Keyboard
F1
Function Key F1
F2
Function Key F2
F3
Function Key F3
F4
Function Key F4
F5
Function Key F5
F6
Function Key F6
F7
Function Key F7
F8
Function Key F8
F9
Function Key F9
F10
Function Key F10
F11
Function Key F11
F12
Function Key F12
PrintScreen
The Print Screen Key
SysRq
The Sys Req key (you get this keycode with Alt + PrintScreen)
ScrollLock
The Scroll Lock key
PauseBreak
The Pause/Break key
Oem8
Symbol key to the left of Key1
Key1
Number Line, Digit 1
Key2
Number Line, Digit 2
Key3
Number Line, Digit 3
Key4
Number Line, Digit 4
Key5
Number Line, Digit 5
Key6
Number Line, Digit 6
Key7
Number Line, Digit 7
Key8
Number Line, Digit 8
Key9
Number Line, Digit 9
Key0
Number Line, Digit 0
OemMinus
US Minus/Underscore Key (right of ‘Key0’)
OemPlus
US Equals/Plus Key (right of ‘OemMinus’)
Backspace
Backspace
Insert
Top Left of the Extended Block
Home
Top Middle of the Extended Block
PageUp
Top Right of the Extended Block
NumpadLock
The Num Lock key
NumpadDivide
The Numpad Divide (or Slash) key
NumpadMultiply
The Numpad Multiple (or Star) key
NumpadSubtract
The Numpad Subtract (or Minus) key
Tab
The Tab Key
Q
Letters, Top Row #1
W
Letters, Top Row #2
E
Letters, Top Row #3
R
Letters, Top Row #4
T
Letters, Top Row #5
Y
Letters, Top Row #6
U
Letters, Top Row #7
I
Letters, Top Row #8
O
Letters, Top Row #9
P
Letters, Top Row #10
Oem4
US ANSI Left-Square-Bracket key
Oem6
US ANSI Right-Square-Bracket key
Oem5
US ANSI Backslash Key / UK ISO Backslash Key
Oem7
The UK/ISO Hash/Tilde key (ISO layout only)
Delete
The Delete key - bottom Left of the Extended Block
End
The End key - bottom Middle of the Extended Block
PageDown
The Page Down key - -bottom Right of the Extended Block
Numpad7
The Numpad 7/Home key
Numpad8
The Numpad 8/Up Arrow key
Numpad9
The Numpad 9/Page Up key
NumpadAdd
The Numpad Add/Plus key
CapsLock
Caps Lock
A
Letters, Middle Row #1
S
Letters, Middle Row #2
D
Letters, Middle Row #3
F
Letters, Middle Row #4
G
Letters, Middle Row #5
H
Letters, Middle Row #6
J
Letters, Middle Row #7
K
Letters, Middle Row #8
L
Letters, Middle Row #9
Oem1
The US ANSI Semicolon/Colon key
Oem3
The US ANSI Single-Quote/At key
Return
The Return Key
Numpad4
The Numpad 4/Left Arrow key
Numpad5
The Numpad 5 Key
Numpad6
The Numpad 6/Right Arrow key
LShift
Left Shift
Z
Letters, Bottom Row #1
X
Letters, Bottom Row #2
C
Letters, Bottom Row #3
V
Letters, Bottom Row #4
B
Letters, Bottom Row #5
N
Letters, Bottom Row #6
M
Letters, Bottom Row #7
OemComma
US ANSI ,<
key
OemPeriod
US ANSI .>
Key
Oem2
US ANSI /?
Key
RShift
Right Shift
ArrowUp
The up-arrow in the inverted-T
Numpad1
Numpad 1/End Key
Numpad2
Numpad 2/Arrow Down Key
Numpad3
Numpad 3/Page Down Key
NumpadEnter
Numpad Enter
LControl
The left-hand Control key
LWin
The left-hand ‘Windows’ key
LAlt
The left-hand Alt key
Spacebar
The Space Bar
RAltGr
The right-hand AltGr key
RWin
The right-hand Win key
Apps
The ‘Apps’ key (aka ‘Menu’ or ‘Right-Click’)
RControl
The right-hand Control key
ArrowLeft
The left-arrow in the inverted-T
ArrowDown
The down-arrow in the inverted-T
ArrowRight
The right-arrow in the inverted-T
Numpad0
The Numpad 0/Insert Key
NumpadPeriod
The Numppad Period/Delete Key
Oem9
Extra JIS key (0x7B)
Oem10
Extra JIS key (0x79)
Oem11
Extra JIS key (0x70)
Oem12
Extra JIS symbol key (0x73)
Oem13
Extra JIS symbol key (0x7D)
PrevTrack
Multi-media keys - Previous Track
NextTrack
Multi-media keys - Next Track
Mute
Multi-media keys - Volume Mute Toggle
Calculator
Multi-media keys - Open Calculator
Play
Multi-media keys - Play
Stop
Multi-media keys - Stop
VolumeDown
Multi-media keys - Increase Volume
VolumeUp
Multi-media keys - Decrease Volume
WWWHome
Multi-media keys - Open Browser
PowerOnTestOk
Sent when the keyboard boots
TooManyKeys
Sent by the keyboard when too many keys are pressed
RControl2
Used as a ‘hidden’ Right Control Key (Pause = RControl2 + Num Lock)
RAlt2
Used as a ‘hidden’ Right Alt Key (Print Screen = RAlt2 + PrntScr)
Trait Implementations§
source§impl Ord for KeyCode
impl Ord for KeyCode
source§impl PartialEq<KeyCode> for KeyCode
impl PartialEq<KeyCode> for KeyCode
source§impl PartialOrd<KeyCode> for KeyCode
impl PartialOrd<KeyCode> for KeyCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more