Enum wry::application::keyboard::KeyCode [−][src]
#[non_exhaustive]
pub enum KeyCode {
Show 194 variants
Unidentified(NativeKeyCode),
Backquote,
Backslash,
BracketLeft,
BracketRight,
Comma,
Digit0,
Digit1,
Digit2,
Digit3,
Digit4,
Digit5,
Digit6,
Digit7,
Digit8,
Digit9,
Equal,
IntlBackslash,
IntlRo,
IntlYen,
KeyA,
KeyB,
KeyC,
KeyD,
KeyE,
KeyF,
KeyG,
KeyH,
KeyI,
KeyJ,
KeyK,
KeyL,
KeyM,
KeyN,
KeyO,
KeyP,
KeyQ,
KeyR,
KeyS,
KeyT,
KeyU,
KeyV,
KeyW,
KeyX,
KeyY,
KeyZ,
Minus,
Period,
Quote,
Semicolon,
Slash,
AltLeft,
AltRight,
Backspace,
CapsLock,
ContextMenu,
ControlLeft,
ControlRight,
Enter,
SuperLeft,
SuperRight,
ShiftLeft,
ShiftRight,
Space,
Tab,
Convert,
KanaMode,
Lang1,
Lang2,
Lang3,
Lang4,
Lang5,
NonConvert,
Delete,
End,
Help,
Home,
Insert,
PageDown,
PageUp,
ArrowDown,
ArrowLeft,
ArrowRight,
ArrowUp,
NumLock,
Numpad0,
Numpad1,
Numpad2,
Numpad3,
Numpad4,
Numpad5,
Numpad6,
Numpad7,
Numpad8,
Numpad9,
NumpadAdd,
NumpadBackspace,
NumpadClear,
NumpadClearEntry,
NumpadComma,
NumpadDecimal,
NumpadDivide,
NumpadEnter,
NumpadEqual,
NumpadHash,
NumpadMemoryAdd,
NumpadMemoryClear,
NumpadMemoryRecall,
NumpadMemoryStore,
NumpadMemorySubtract,
NumpadMultiply,
NumpadParenLeft,
NumpadParenRight,
NumpadStar,
NumpadSubtract,
Escape,
Fn,
FnLock,
PrintScreen,
ScrollLock,
Pause,
BrowserBack,
BrowserFavorites,
BrowserForward,
BrowserHome,
BrowserRefresh,
BrowserSearch,
BrowserStop,
Eject,
LaunchApp1,
LaunchApp2,
LaunchMail,
MediaPlayPause,
MediaSelect,
MediaStop,
MediaTrackNext,
MediaTrackPrevious,
Power,
Sleep,
AudioVolumeDown,
AudioVolumeMute,
AudioVolumeUp,
WakeUp,
Hyper,
Turbo,
Abort,
Resume,
Suspend,
Again,
Copy,
Cut,
Find,
Open,
Paste,
Props,
Select,
Undo,
Hiragana,
Katakana,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
F21,
F22,
F23,
F24,
F25,
F26,
F27,
F28,
F29,
F30,
F31,
F32,
F33,
F34,
F35,
}
Expand description
Represents the code of a physical key.
This mostly conforms to the UI Events Specification’s KeyboardEvent.code
with a few
exceptions:
- The keys that the specification calls “MetaLeft” and “MetaRight” are named “SuperLeft” and “SuperRight” here.
- The key that the specification calls “Super” is reported as
Unidentified
here. - The
Unidentified
variant here, can still identifiy a key through it’sNativeKeyCode
.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Unidentified(NativeKeyCode)
This variant is used when the key cannot be translated to any other variant.
The native scancode is provided (if available) in order to allow the user to specify keybindings for keys which are not defined by this API.
` on a US keyboard. This is also called a backtick or grave. This is the 半角/全角/漢字 (hankaku/zenkaku/kanji) key on Japanese keyboards
Used for both the US \ (on the 101-key layout) and also for the key located between the “ and Enter keys on row C of the 102-, 104- and 106-key layouts. Labeled # on a UK (102) keyboard.
[ on a US keyboard.
] on a US keyboard.
, on a US keyboard.
0 on a US keyboard.
1 on a US keyboard.
2 on a US keyboard.
3 on a US keyboard.
4 on a US keyboard.
5 on a US keyboard.
6 on a US keyboard.
7 on a US keyboard.
8 on a US keyboard.
9 on a US keyboard.
= on a US keyboard.
Located between the left Shift and Z keys. Labeled \ on a UK keyboard.
Located between the / and right Shift keys. Labeled \ (ro) on a Japanese keyboard.
Located between the = and Backspace keys. Labeled ¥ (yen) on a Japanese keyboard. \ on a Russian keyboard.
a on a US keyboard. Labeled q on an AZERTY (e.g., French) keyboard.
b on a US keyboard.
c on a US keyboard.
d on a US keyboard.
e on a US keyboard.
f on a US keyboard.
g on a US keyboard.
h on a US keyboard.
i on a US keyboard.
j on a US keyboard.
k on a US keyboard.
l on a US keyboard.
m on a US keyboard.
n on a US keyboard.
o on a US keyboard.
p on a US keyboard.
q on a US keyboard. Labeled a on an AZERTY (e.g., French) keyboard.
r on a US keyboard.
s on a US keyboard.
t on a US keyboard.
u on a US keyboard.
v on a US keyboard.
w on a US keyboard. Labeled z on an AZERTY (e.g., French) keyboard.
x on a US keyboard.
y on a US keyboard. Labeled z on a QWERTZ (e.g., German) keyboard.
z on a US keyboard. Labeled w on an AZERTY (e.g., French) keyboard, and y on a QWERTZ (e.g., German) keyboard.
- on a US keyboard.
. on a US keyboard.
’ on a US keyboard.
; on a US keyboard.
/ on a US keyboard.
Alt, Option, or ⌥.
Alt, Option, or ⌥. This is labeled AltGr on many keyboard layouts.
Backspace or ⌫. Labeled Delete on Apple keyboards.
CapsLock or ⇪
The application context menu key, which is typically found between the right Super key and the right Control key.
Control or ⌃
Control or ⌃
Enter or ↵. Labeled Return on Apple keyboards.
The Windows, ⌘, Command, or other OS symbol key.
The Windows, ⌘, Command, or other OS symbol key.
Shift or ⇧
Shift or ⇧
(space)
Tab or ⇥
Japanese: 変 (henkan)
Japanese: カタカナ/ひらがな/ローマ字 (katakana/hiragana/romaji)
Korean: HangulMode 한/영 (han/yeong)
Japanese (Mac keyboard): か (kana)
Korean: Hanja 한 (hanja)
Japanese (Mac keyboard): 英 (eisu)
Japanese (word-processing keyboard): Katakana
Japanese (word-processing keyboard): Hiragana
Japanese (word-processing keyboard): Zenkaku/Hankaku
Japanese: 無変換 (muhenkan)
⌦. The forward delete key.
Note that on Apple keyboards, the key labelled Delete on the main part of
the keyboard is encoded as Backspace
.
Page Down, End, or ↘
Help. Not present on standard PC keyboards.
Home or ↖
Insert or Ins. Not present on Apple keyboards.
Page Down, PgDn, or ⇟
Page Up, PgUp, or ⇞
↓
←
→
↑
On the Mac, this is used for the numpad Clear key.
0 Ins on a keyboard. 0 on a phone or remote control
1 End on a keyboard. 1 or 1 QZ on a phone or remote control
2 ↓ on a keyboard. 2 ABC on a phone or remote control
3 PgDn on a keyboard. 3 DEF on a phone or remote control
4 ← on a keyboard. 4 GHI on a phone or remote control
5 on a keyboard. 5 JKL on a phone or remote control
6 → on a keyboard. 6 MNO on a phone or remote control
7 Home on a keyboard. 7 PQRS or 7 PRS on a phone or remote control
8 ↑ on a keyboard. 8 TUV on a phone or remote control
9 PgUp on a keyboard. 9 WXYZ or 9 WXY on a phone or remote control
+
Found on the Microsoft Natural Keyboard.
C or A (All Clear). Also for use with numpads that have a
Clear key that is separate from the NumLock key. On the Mac, the
numpad Clear key is encoded as NumLock
.
C (Clear Entry)
, (thousands separator). For locales where the thousands separator is a “.” (e.g., Brazil), this key may generate a ..
. Del. For locales where the decimal separator is “,” (e.g., Brazil), this key may generate a ,.
/
=
# on a phone or remote control device. This key is typically found below the 9 key and to the right of the 0 key.
M Add current entry to the value stored in memory.
M Clear the value stored in memory.
M Replace the current entry with the value stored in memory.
M Replace the value stored in memory with the current entry.
M Subtract current entry from the value stored in memory.
on a keyboard. For use with numpads that provide mathematical operations (+, - and /).
Use NumpadStar
for the * key on phones and remote controls.
( Found on the Microsoft Natural Keyboard.
) Found on the Microsoft Natural Keyboard.
* on a phone or remote control device.
This key is typically found below the 7 key and to the left of the 0 key.
Use “NumpadMultiply” for the * key on numeric keypads.
-
Esc or ⎋
Fn This is typically a hardware key that does not generate a separate code.
FLock or FnLock. Function Lock key. Found on the Microsoft Natural Keyboard.
PrtScr SysRq or Print Screen
Scroll Lock
Pause Break
Some laptops place this key to the left of the ↑ key.
This also the “back” button (triangle) on Android.
Some laptops place this key to the right of the ↑ key.
The “home” button on Android.
Eject or ⏏. This key is placed in the function section on some Apple keyboards.
Sometimes labelled My Computer on the keyboard
Sometimes labelled Calculator on the keyboard
This key is placed in the function section on some Apple keyboards, replacing the Eject key.
Found on Sun’s USB keyboard.
Found on Sun’s USB keyboard.
Found on Sun’s USB keyboard.
Found on Sun’s USB keyboard.
Found on Sun’s USB keyboard.
Found on Sun’s USB keyboard.
Found on Sun’s USB keyboard.
Found on Sun’s USB keyboard.
Found on Sun’s USB keyboard.
Use for dedicated ひらがな key found on some Japanese word processing keyboards.
Use for dedicated カタカナ key found on some Japanese word processing keyboards.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key. Usually found at the top of the keyboard.
General-purpose function key.
General-purpose function key.
General-purpose function key.
General-purpose function key.
General-purpose function key.
General-purpose function key.
General-purpose function key.
General-purpose function key.
General-purpose function key.
General-purpose function key.
General-purpose function key.
Implementations
Return platform specific scancode.
Return KeyCode
from platform scancode.
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<KeyCode, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<KeyCode, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for KeyCode
impl UnwindSafe for KeyCode
Blanket Implementations
Mutably borrows from an owned value. Read more