#[repr(u16)]pub enum VirtualKey {
Show 113 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,
MediaNextTrack = 176,
MediaPrevTrack = 177,
MediaStop = 178,
MediaPlayPause = 179,
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),
}Available on crate feature
input only.Expand description
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
MediaNextTrack = 176
MediaPrevTrack = 177
MediaStop = 178
MediaPlayPause = 179
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 VirtualKey
impl VirtualKey
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<VirtualKey> for Modifier
impl Add<VirtualKey> for Modifier
Source§type Output = KeyCombination
type Output = KeyCombination
The resulting type after applying the
+ operator.Source§impl Add<VirtualKey> for ModifierCombination
impl Add<VirtualKey> for ModifierCombination
Source§type Output = KeyCombination
type Output = KeyCombination
The resulting type after applying the
+ operator.Source§impl Clone for VirtualKey
impl Clone for VirtualKey
Source§fn clone(&self) -> VirtualKey
fn clone(&self) -> VirtualKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VirtualKey
impl Debug for VirtualKey
Source§impl From<VirtualKey> for KeyCombination
impl From<VirtualKey> for KeyCombination
Source§fn from(key: VirtualKey) -> Self
fn from(key: VirtualKey) -> Self
Converts to this type from the input type.
Source§impl From<VirtualKey> for i32
impl From<VirtualKey> for i32
Source§fn from(value: VirtualKey) -> Self
fn from(value: VirtualKey) -> Self
Converts to this type from the input type.
Source§impl From<VirtualKey> for u16
impl From<VirtualKey> for u16
Source§fn from(enum_value: VirtualKey) -> Self
fn from(enum_value: VirtualKey) -> Self
Converts to this type from the input type.
Source§impl From<VirtualKey> for u32
impl From<VirtualKey> for u32
Source§fn from(value: VirtualKey) -> Self
fn from(value: VirtualKey) -> Self
Converts to this type from the input type.
Source§impl From<u16> for VirtualKey
impl From<u16> for VirtualKey
Source§impl FromPrimitive for VirtualKey
impl FromPrimitive for VirtualKey
Source§impl GenericKey for VirtualKey
impl GenericKey for VirtualKey
Source§impl Hash for VirtualKey
impl Hash for VirtualKey
Source§impl PartialEq for VirtualKey
impl PartialEq for VirtualKey
impl Copy for VirtualKey
impl Eq for VirtualKey
impl StructuralPartialEq for VirtualKey
Auto Trait Implementations§
impl Freeze for VirtualKey
impl RefUnwindSafe for VirtualKey
impl Send for VirtualKey
impl Sync for VirtualKey
impl Unpin for VirtualKey
impl UnwindSafe for VirtualKey
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
Mutably borrows from an owned value. Read more