#[repr(u16)]pub enum KeyboardKey {
Show 109 variants
Backspace = 8,
Tab = 9,
Return = 13,
Pause = 19,
CapsLock = 20,
Esc = 27,
Space = 32,
PgUp = 33,
PgDown = 34,
End = 35,
Home = 36,
LeftArrow = 37,
UpArrow = 38,
RightArrow = 39,
DownArrow = 40,
PrintScreen = 44,
Insert = 45,
Delete = 46,
Number0 = 48,
Number1 = 49,
Number2 = 50,
Number3 = 51,
Number4 = 52,
Number5 = 53,
Number6 = 54,
Number7 = 55,
Number8 = 56,
Number9 = 57,
A = 65,
B = 66,
C = 67,
D = 68,
E = 69,
F = 70,
G = 71,
H = 72,
I = 73,
J = 74,
K = 75,
L = 76,
M = 77,
N = 78,
O = 79,
P = 80,
Q = 81,
R = 82,
S = 83,
T = 84,
U = 85,
V = 86,
W = 87,
X = 88,
Y = 89,
Z = 90,
LeftWindows = 91,
RightWindows = 92,
Menu = 93,
Numpad0 = 96,
Numpad1 = 97,
Numpad2 = 98,
Numpad3 = 99,
Numpad4 = 100,
Numpad5 = 101,
Numpad6 = 102,
Numpad7 = 103,
Numpad8 = 104,
Numpad9 = 105,
Multiply = 106,
Add = 107,
Subtract = 109,
Decimal = 110,
Divide = 111,
F1 = 112,
F2 = 113,
F3 = 114,
F4 = 115,
F5 = 116,
F6 = 117,
F7 = 118,
F8 = 119,
F9 = 120,
F10 = 121,
F11 = 122,
F12 = 123,
NumLock = 144,
ScrollLock = 145,
LeftShift = 160,
RightShift = 161,
LeftCtrl = 162,
RightCtrl = 163,
LeftAlt = 164,
RightAlt = 165,
VolumeMute = 173,
VolumeDown = 174,
VolumeUp = 175,
Oem1 = 186,
OemPlus = 187,
OemComma = 188,
OemMinus = 189,
OemPeriod = 190,
Oem2 = 191,
Oem3 = 192,
Oem4 = 219,
Oem5 = 220,
Oem6 = 221,
Oem7 = 222,
Oem8 = 223,
Oem102 = 226,
Other(u16),
}
input
only.Expand description
Keyboard key with a virtual key code, usable for hotkeys.
§Related docs
Variants§
Backspace = 8
Tab = 9
Return = 13
Pause = 19
CapsLock = 20
Esc = 27
Space = 32
PgUp = 33
PgDown = 34
End = 35
Home = 36
LeftArrow = 37
UpArrow = 38
RightArrow = 39
DownArrow = 40
PrintScreen = 44
Insert = 45
Delete = 46
Number0 = 48
Number1 = 49
Number2 = 50
Number3 = 51
Number4 = 52
Number5 = 53
Number6 = 54
Number7 = 55
Number8 = 56
Number9 = 57
A = 65
B = 66
C = 67
D = 68
E = 69
F = 70
G = 71
H = 72
I = 73
J = 74
K = 75
L = 76
M = 77
N = 78
O = 79
P = 80
Q = 81
R = 82
S = 83
T = 84
U = 85
V = 86
W = 87
X = 88
Y = 89
Z = 90
LeftWindows = 91
RightWindows = 92
Menu = 93
Numpad0 = 96
Numpad1 = 97
Numpad2 = 98
Numpad3 = 99
Numpad4 = 100
Numpad5 = 101
Numpad6 = 102
Numpad7 = 103
Numpad8 = 104
Numpad9 = 105
Multiply = 106
Add = 107
Subtract = 109
Decimal = 110
Divide = 111
F1 = 112
F2 = 113
F3 = 114
F4 = 115
F5 = 116
F6 = 117
F7 = 118
F8 = 119
F9 = 120
F10 = 121
F11 = 122
F12 = 123
NumLock = 144
ScrollLock = 145
LeftShift = 160
RightShift = 161
LeftCtrl = 162
RightCtrl = 163
LeftAlt = 164
RightAlt = 165
VolumeMute = 173
VolumeDown = 174
VolumeUp = 175
Oem1 = 186
Used for miscellaneous characters; it can vary by keyboard.
- For the US standard keyboard, the ‘;:’ key
- For the German keyboard, the ‘ü’ key
OemPlus = 187
For any country/region, the ‘+’ key
OemComma = 188
For any country/region, the ‘,’ key
OemMinus = 189
For any country/region, the ‘-’ key
OemPeriod = 190
For any country/region, the ‘.’ key
Oem2 = 191
Used for miscellaneous characters; it can vary by keyboard.
- For the US standard keyboard, the ‘/?’ key
- For the German keyboard, the ‘#’’ key
Oem3 = 192
Used for miscellaneous characters; it can vary by keyboard.
- For the US standard keyboard, the ‘`~’ key
- For the German keyboard, the ‘ö’ key
Oem4 = 219
Used for miscellaneous characters; it can vary by keyboard.
- For the US standard keyboard, the ‘[{’ key
- For the German keyboard, the ‘ß?’ key
Oem5 = 220
Used for miscellaneous characters; it can vary by keyboard.
- For the US standard keyboard, the ‘|’ key besides ‘Enter’
- For the German keyboard, the ‘^°’ key
Oem6 = 221
Used for miscellaneous characters; it can vary by keyboard.
- For the US standard keyboard, the ‘]}’ key
- For the German keyboard, the ‘´`’ key
Oem7 = 222
Used for miscellaneous characters; it can vary by keyboard.
- For the US standard keyboard, the ‘single-quote/double-quote’ key
- For the German keyboard, the ‘ä’ key
Oem8 = 223
Oem102 = 226
Used for miscellaneous characters; it can vary by keyboard.
- For the US standard keyboard, the ‘|’ key besides the ‘z’ key
- For the German keyboard, the ‘<>’ key
Other(u16)
Other virtual key code.
Implementations§
Source§impl KeyboardKey
impl KeyboardKey
Sourcepub fn is_lock_toggled(self) -> bool
pub fn is_lock_toggled(self) -> bool
Returns true if the key has lock functionality (e.g. Caps Lock) and the lock is toggled.
Trait Implementations§
Source§impl Add<KeyboardKey> for Modifier
impl Add<KeyboardKey> for Modifier
Source§type Output = KeyCombination
type Output = KeyCombination
+
operator.Source§impl Add<KeyboardKey> for ModifierCombination
impl Add<KeyboardKey> for ModifierCombination
Source§type Output = KeyCombination
type Output = KeyCombination
+
operator.Source§impl Clone for KeyboardKey
impl Clone for KeyboardKey
Source§fn clone(&self) -> KeyboardKey
fn clone(&self) -> KeyboardKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more