#[repr(u8)]pub enum KeyCode {
Show 193 variants
No = 0,
ErrorRollOver = 1,
PostFail = 2,
ErrorUndefined = 3,
A = 4,
B = 5,
C = 6,
D = 7,
E = 8,
F = 9,
G = 10,
H = 11,
I = 12,
J = 13,
K = 14,
L = 15,
M = 16,
N = 17,
O = 18,
P = 19,
Q = 20,
R = 21,
S = 22,
T = 23,
U = 24,
V = 25,
W = 26,
X = 27,
Y = 28,
Z = 29,
Kb1 = 30,
Kb2 = 31,
Kb3 = 32,
Kb4 = 33,
Kb5 = 34,
Kb6 = 35,
Kb7 = 36,
Kb8 = 37,
Kb9 = 38,
Kb0 = 39,
Enter = 40,
Escape = 41,
BSpace = 42,
Tab = 43,
Space = 44,
Minus = 45,
Equal = 46,
LBracket = 47,
RBracket = 48,
Bslash = 49,
NonUsHash = 50,
SColon = 51,
Quote = 52,
Grave = 53,
Comma = 54,
Dot = 55,
Slash = 56,
CapsLock = 57,
F1 = 58,
F2 = 59,
F3 = 60,
F4 = 61,
F5 = 62,
F6 = 63,
F7 = 64,
F8 = 65,
F9 = 66,
F10 = 67,
F11 = 68,
F12 = 69,
PScreen = 70,
ScrollLock = 71,
Pause = 72,
Insert = 73,
Home = 74,
PgUp = 75,
Delete = 76,
End = 77,
PgDown = 78,
Right = 79,
Left = 80,
Down = 81,
Up = 82,
NumLock = 83,
KpSlash = 84,
KpAsterisk = 85,
KpMinus = 86,
KpPlus = 87,
KpEnter = 88,
Kp1 = 89,
Kp2 = 90,
Kp3 = 91,
Kp4 = 92,
Kp5 = 93,
Kp6 = 94,
Kp7 = 95,
Kp8 = 96,
Kp9 = 97,
Kp0 = 98,
KpDot = 99,
NonUsBslash = 100,
Application = 101,
Power = 102,
KpEqual = 103,
F13 = 104,
F14 = 105,
F15 = 106,
F16 = 107,
F17 = 108,
F18 = 109,
F19 = 110,
F20 = 111,
F21 = 112,
F22 = 113,
F23 = 114,
F24 = 115,
Execute = 116,
Help = 117,
Menu = 118,
Select = 119,
Stop = 120,
Again = 121,
Undo = 122,
Cut = 123,
Copy = 124,
Paste = 125,
Find = 126,
Mute = 127,
VolUp = 128,
VolDown = 129,
LockingCapsLock = 130,
LockingNumLock = 131,
LockingScrollLock = 132,
KpComma = 133,
KpEqualSign = 134,
Intl1 = 135,
Intl2 = 136,
Intl3 = 137,
Intl4 = 138,
Intl5 = 139,
Intl6 = 140,
Intl7 = 141,
Intl8 = 142,
Intl9 = 143,
Lang1 = 144,
Lang2 = 145,
Lang3 = 146,
Lang4 = 147,
Lang5 = 148,
Lang6 = 149,
Lang7 = 150,
Lang8 = 151,
Lang9 = 152,
AltErase = 153,
SysReq = 154,
Cancel = 155,
Clear = 156,
Prior = 157,
Return = 158,
Separator = 159,
Out = 160,
Oper = 161,
ClearAgain = 162,
CrSel = 163,
ExSel = 164,
LCtrl = 224,
LShift = 225,
LAlt = 226,
LGui = 227,
RCtrl = 228,
RShift = 229,
RAlt = 230,
RGui = 231,
MediaPlayPause = 232,
MediaStopCD = 233,
MediaPreviousSong = 234,
MediaNextSong = 235,
MediaEjectCD = 236,
MediaVolUp = 237,
MediaVolDown = 238,
MediaMute = 239,
MediaWWW = 240,
MediaBack = 241,
MediaForward = 242,
MediaStop = 243,
MediaFind = 244,
MediaScrollUp = 245,
MediaScrollDown = 246,
MediaEdit = 247,
MediaSleep = 248,
MeidaCoffee = 249,
MediaRefresh = 250,
MediaCalc = 251,
}
Expand description
Define a key code according to the HID specification. Their names correspond to the american QWERTY layout.
Variants§
No = 0
The “no” key, a placeholder to express nothing.
ErrorRollOver = 1
Error if too much keys are pressed at the same time.
PostFail = 2
The POST fail error.
ErrorUndefined = 3
An undefined error occured.
A = 4
a
and A
.
B = 5
C = 6
D = 7
E = 8
F = 9
G = 10
H = 11
I = 12
J = 13
K = 14
L = 15
M = 16
N = 17
O = 18
P = 19
Q = 20
R = 21
S = 22
T = 23
U = 24
V = 25
W = 26
X = 27
Y = 28
Z = 29
Kb1 = 30
1
and !
.
Kb2 = 31
2
and @
.
Kb3 = 32
3
and #
.
Kb4 = 33
4
and $
.
Kb5 = 34
5
and %
.
Kb6 = 35
6
and ^
.
Kb7 = 36
7
and &
.
Kb8 = 37
8
and *
.
Kb9 = 38
9
and (
.
Kb0 = 39
0
and )
.
Enter = 40
Escape = 41
BSpace = 42
Tab = 43
Space = 44
Minus = 45
-
and _
.
Equal = 46
=
and +
.
LBracket = 47
[
and {
.
RBracket = 48
]
and }
.
Bslash = 49
\
and |
.
NonUsHash = 50
Non-US #
and ~
(Typically near the Enter key).
SColon = 51
;
and :
.
Quote = 52
'
and "
.
Grave = 53
` and ~
.
Comma = 54
,
and <
.
Dot = 55
.
and >
.
Slash = 56
/
and ?
.
CapsLock = 57
F1 = 58
F2 = 59
F3 = 60
F4 = 61
F5 = 62
F6 = 63
F7 = 64
F8 = 65
F9 = 66
F10 = 67
F11 = 68
F12 = 69
PScreen = 70
ScrollLock = 71
Pause = 72
Insert = 73
Home = 74
PgUp = 75
Delete = 76
End = 77
PgDown = 78
Right = 79
Left = 80
Down = 81
Up = 82
NumLock = 83
KpSlash = 84
Keypad /
KpAsterisk = 85
Keypad *
KpMinus = 86
Keypad -
.
KpPlus = 87
Keypad +
.
KpEnter = 88
Keypad enter.
Kp1 = 89
Keypad 1.
Kp2 = 90
Kp3 = 91
Kp4 = 92
Kp5 = 93
Kp6 = 94
Kp7 = 95
Kp8 = 96
Kp9 = 97
Kp0 = 98
KpDot = 99
NonUsBslash = 100
Non-US \
and |
(Typically near the Left-Shift key)
Application = 101
Power = 102
not a key, used for errors
KpEqual = 103
Keypad =
.
F13 = 104
F14 = 105
F15 = 106
F16 = 107
F17 = 108
F18 = 109
F19 = 110
F20 = 111
F21 = 112
F22 = 113
F23 = 114
F24 = 115
Execute = 116
Help = 117
Menu = 118
Select = 119
Stop = 120
Again = 121
Undo = 122
Cut = 123
Copy = 124
Paste = 125
Find = 126
Mute = 127
VolUp = 128
VolDown = 129
LockingCapsLock = 130
Deprecated.
LockingNumLock = 131
Deprecated.
LockingScrollLock = 132
Deprecated.
KpComma = 133
Keypad ,
, also used for the brazilian keypad period (.) key.
KpEqualSign = 134
Used on AS/400 keyboard
Intl1 = 135
Intl2 = 136
Intl3 = 137
Intl4 = 138
Intl5 = 139
Intl6 = 140
Intl7 = 141
Intl8 = 142
Intl9 = 143
Lang1 = 144
Lang2 = 145
Lang3 = 146
Lang4 = 147
Lang5 = 148
Lang6 = 149
Lang7 = 150
Lang8 = 151
Lang9 = 152
AltErase = 153
SysReq = 154
Cancel = 155
Clear = 156
Prior = 157
Return = 158
Separator = 159
Out = 160
Oper = 161
ClearAgain = 162
CrSel = 163
ExSel = 164
LCtrl = 224
Left Control.
LShift = 225
Left Shift.
LAlt = 226
Left Alt.
LGui = 227
Left GUI (the Windows key).
RCtrl = 228
Right Control.
RShift = 229
Right Shift.
RAlt = 230
Right Alt (or Alt Gr).
RGui = 231
Right GUI (the Windows key).
MediaPlayPause = 232
MediaStopCD = 233
MediaPreviousSong = 234
MediaNextSong = 235
MediaEjectCD = 236
MediaVolUp = 237
MediaVolDown = 238
MediaMute = 239
MediaWWW = 240
MediaBack = 241
MediaForward = 242
MediaStop = 243
MediaFind = 244
MediaScrollUp = 245
MediaScrollDown = 246
MediaEdit = 247
MediaSleep = 248
MeidaCoffee = 249
MediaRefresh = 250
MediaCalc = 251
Implementations§
Source§impl KeyCode
impl KeyCode
Sourcepub fn is_modifier(self) -> bool
pub fn is_modifier(self) -> bool
Returns true
if the key code correspond to a modifier (send
separately on USB HID report).
Sourcepub fn as_modifier_bit(self) -> u8
pub fn as_modifier_bit(self) -> u8
Returns the byte with the bit corresponding to the USB HID modifier bitfield setted.
Trait Implementations§
Source§impl FromIterator<KeyCode> for KbHidReport
impl FromIterator<KeyCode> for KbHidReport
Source§impl Ord for KeyCode
impl Ord for KeyCode
Source§impl PartialOrd for KeyCode
impl PartialOrd for KeyCode
impl Copy for KeyCode
impl Eq for KeyCode
impl StructuralPartialEq for KeyCode
Auto Trait Implementations§
impl Freeze for KeyCode
impl RefUnwindSafe for KeyCode
impl Send for KeyCode
impl Sync for KeyCode
impl Unpin for KeyCode
impl UnwindSafe for KeyCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more