pub enum Key {
Show 254 variants
Num0,
Num1,
Num2,
Num3,
Num4,
Num5,
Num6,
Num7,
Num8,
Num9,
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,
AbntC1,
AbntC2,
Accept,
Add,
Alt,
Apps,
Attn,
Backspace,
BrowserBack,
BrowserFavorites,
BrowserForward,
BrowserHome,
BrowserRefresh,
BrowserSearch,
BrowserStop,
Cancel,
CapsLock,
Clear,
Command,
Control,
Convert,
Crsel,
DBEAlphanumeric,
DBECodeinput,
DBEDetermineString,
DBEEnterDLGConversionMode,
DBEEnterIMEConfigMode,
DBEEnterWordRegisterMode,
DBEFlushString,
DBEHiragana,
DBEKatakana,
DBENoCodepoint,
DBENoRoman,
DBERoman,
DBESBCSChar,
DBESChar,
Decimal,
Delete,
Divide,
DownArrow,
End,
Ereof,
Escape,
Execute,
Exsel,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
F21,
F22,
F23,
F24,
Final,
GamepadA,
GamepadB,
GamepadDPadDown,
GamepadDPadLeft,
GamepadDPadRight,
GamepadDPadUp,
GamepadLeftShoulder,
GamepadLeftThumbstickButton,
GamepadLeftThumbstickDown,
GamepadLeftThumbstickLeft,
GamepadLeftThumbstickRight,
GamepadLeftThumbstickUp,
GamepadLeftTrigger,
GamepadMenu,
GamepadRightShoulder,
GamepadRightThumbstickButton,
GamepadRightThumbstickDown,
GamepadRightThumbstickLeft,
GamepadRightThumbstickRight,
GamepadRightThumbstickUp,
GamepadRightTrigger,
GamepadView,
GamepadX,
GamepadY,
Hangeul,
Hangul,
Hanja,
Help,
Home,
Ico00,
IcoClear,
IcoHelp,
IMEOff,
IMEOn,
Insert,
Junja,
Kana,
Kanji,
LaunchApp1,
LaunchApp2,
LaunchMail,
LaunchMediaSelect,
LButton,
LControl,
LeftArrow,
LMenu,
LShift,
LWin,
MButton,
MediaNextTrack,
MediaPlayPause,
MediaPrevTrack,
MediaStop,
Meta,
ModeChange,
Multiply,
NavigationAccept,
NavigationCancel,
NavigationDown,
NavigationLeft,
NavigationMenu,
NavigationRight,
NavigationUp,
NavigationView,
NoName,
NonConvert,
None,
Numlock,
Numpad0,
Numpad1,
Numpad2,
Numpad3,
Numpad4,
Numpad5,
Numpad6,
Numpad7,
Numpad8,
Numpad9,
OEM1,
OEM102,
OEM2,
OEM3,
OEM4,
OEM5,
OEM6,
OEM7,
OEM8,
OEMAttn,
OEMAuto,
OEMAx,
OEMBacktab,
OEMClear,
OEMComma,
OEMCopy,
OEMCusel,
OEMEnlw,
OEMFinish,
OEMFJJisho,
OEMFJLoya,
OEMFJMasshou,
OEMFJRoya,
OEMFJTouroku,
OEMJump,
OEMMinus,
OEMNECEqual,
OEMPA1,
OEMPA2,
OEMPA3,
OEMPeriod,
OEMPlus,
OEMReset,
OEMWsctrl,
Option,
PA1,
Packet,
PageDown,
PageUp,
Pause,
Play,
Print,
Processkey,
RButton,
RControl,
Return,
RightArrow,
RMenu,
RShift,
RWin,
Scroll,
Select,
Separator,
Shift,
Sleep,
Snapshot,
Space,
Subtract,
Super,
Tab,
UpArrow,
VolumeDown,
VolumeMute,
VolumeUp,
Windows,
XButton1,
XButton2,
Zoom,
Unicode(char),
Other(u32),
}
Expand description
Contains the available keycodes
Use Key::Unicode
to enter arbitrary Unicode chars.
If a key is missing, please open an issue in our repo and we will quickly
add it. In the mean time, you can simulate that key by using Key::Other
or the crate::Keyboard::raw
function. Some of the keys are only
available on a specific platform. Use conditional compilation to use them.
Variants§
Num0
Num1
Num2
Num3
Num4
Num5
Num6
Num7
Num8
Num9
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
AbntC1
AbntC2
Accept
Add
Alt
alt key on Linux and Windows (option key on macOS)
Apps
Attn
Backspace
backspace key
BrowserBack
BrowserFavorites
BrowserForward
BrowserHome
BrowserRefresh
BrowserSearch
BrowserStop
Cancel
CapsLock
caps lock key
Clear
Command
command key on macOS (super key on Linux, windows key on Windows)
Control
control key
Convert
Crsel
DBEAlphanumeric
DBECodeinput
DBEDetermineString
DBEEnterDLGConversionMode
DBEEnterIMEConfigMode
DBEEnterWordRegisterMode
DBEFlushString
DBEHiragana
DBEKatakana
DBENoCodepoint
DBENoRoman
DBERoman
DBESBCSChar
DBESChar
Decimal
Delete
delete key
Divide
DownArrow
down arrow key
End
end key
Ereof
Escape
escape key (esc)
Execute
Exsel
F1
F1 key
F2
F2 key
F3
F3 key
F4
F4 key
F5
F5 key
F6
F6 key
F7
F7 key
F8
F8 key
F9
F9 key
F10
F10 key
F11
F11 key
F12
F12 key
F13
F13 key
F14
F14 key
F15
F15 key
F16
F16 key
F17
F17 key
F18
F18 key
F19
F19 key
F20
F20 key
F21
F21 key
F22
F22 key
F23
F23 key
F24
F24 key
Final
GamepadA
GamepadB
GamepadDPadDown
GamepadDPadLeft
GamepadDPadRight
GamepadDPadUp
GamepadLeftShoulder
GamepadLeftThumbstickButton
GamepadLeftThumbstickDown
GamepadLeftThumbstickLeft
GamepadLeftThumbstickRight
GamepadLeftThumbstickUp
GamepadLeftTrigger
GamepadMenu
GamepadRightShoulder
GamepadRightThumbstickButton
GamepadRightThumbstickDown
GamepadRightThumbstickLeft
GamepadRightThumbstickRight
GamepadRightThumbstickUp
GamepadRightTrigger
GamepadView
GamepadX
GamepadY
Hangeul
Hangul
Hanja
Help
Home
home key
Ico00
IcoClear
IcoHelp
IMEOff
IMEOn
Insert
Junja
Kana
Kanji
LaunchApp1
LaunchApp2
LaunchMail
LaunchMediaSelect
LButton
LControl
LeftArrow
left arrow key
LMenu
LShift
LWin
MButton
MediaNextTrack
MediaPlayPause
MediaPrevTrack
MediaStop
Meta
meta key (also known as “windows”, “super”, and “command”)
ModeChange
Multiply
NoName
NonConvert
None
Numlock
Numpad0
Numpad1
Numpad2
Numpad3
Numpad4
Numpad5
Numpad6
Numpad7
Numpad8
Numpad9
OEM1
OEM102
OEM2
OEM3
OEM4
OEM5
OEM6
OEM7
OEM8
OEMAttn
OEMAuto
OEMAx
OEMBacktab
OEMClear
OEMComma
OEMCopy
OEMCusel
OEMEnlw
OEMFinish
OEMFJJisho
OEMFJLoya
OEMFJMasshou
OEMFJRoya
OEMFJTouroku
OEMJump
OEMMinus
OEMNECEqual
OEMPA1
OEMPA2
OEMPA3
OEMPeriod
OEMPlus
OEMReset
OEMWsctrl
Option
option key on macOS (alt key on Linux and Windows)
PA1
Packet
PageDown
page down key
PageUp
page up key
Pause
Play
Processkey
RButton
RControl
Return
return key
RightArrow
right arrow key
RMenu
RShift
RWin
Scroll
Select
Separator
Shift
shift key
Sleep
Snapshot
Space
space key
Subtract
Super
super key on linux (command key on macOS, windows key on Windows)
Tab
tab key (tabulator)
UpArrow
up arrow key
VolumeDown
VolumeMute
VolumeUp
Windows
windows key on Windows (super key on Linux, command key on macOS)
XButton1
XButton2
Zoom
Unicode(char)
Unicode character
Other(u32)
Use this for keys that are not listed here that you know the
value of. Let us know if you think the key should be listed so
we can add it
On Linux, this will result in a keysym,
On Windows, this will result in a Virtual_Key
and
On macOS, this will yield a KeyCode