#[non_exhaustive]pub enum Code {
Show 194 variants
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,
Meta,
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
Code representing the location 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.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Backquote
` on a US keyboard. This is also called a backtick or grave. This is the 半角/全角/漢字 (hankaku/zenkaku/kanji) key on Japanese keyboards
Backslash
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.
BracketLeft
[ on a US keyboard.
BracketRight
] on a US keyboard.
Comma
, on a US keyboard.
Digit0
0 on a US keyboard.
Digit1
1 on a US keyboard.
Digit2
2 on a US keyboard.
Digit3
3 on a US keyboard.
Digit4
4 on a US keyboard.
Digit5
5 on a US keyboard.
Digit6
6 on a US keyboard.
Digit7
7 on a US keyboard.
Digit8
8 on a US keyboard.
Digit9
9 on a US keyboard.
Equal
= on a US keyboard.
IntlBackslash
Located between the left Shift and Z keys. Labeled \ on a UK keyboard.
IntlRo
Located between the / and right Shift keys. Labeled \ (ro) on a Japanese keyboard.
IntlYen
Located between the = and Backspace keys. Labeled ¥ (yen) on a Japanese keyboard. \ on a Russian keyboard.
KeyA
a on a US keyboard. Labeled q on an AZERTY (e.g., French) keyboard.
KeyB
b on a US keyboard.
KeyC
c on a US keyboard.
KeyD
d on a US keyboard.
KeyE
e on a US keyboard.
KeyF
f on a US keyboard.
KeyG
g on a US keyboard.
KeyH
h on a US keyboard.
KeyI
i on a US keyboard.
KeyJ
j on a US keyboard.
KeyK
k on a US keyboard.
KeyL
l on a US keyboard.
KeyM
m on a US keyboard.
KeyN
n on a US keyboard.
KeyO
o on a US keyboard.
KeyP
p on a US keyboard.
KeyQ
q on a US keyboard. Labeled a on an AZERTY (e.g., French) keyboard.
KeyR
r on a US keyboard.
KeyS
s on a US keyboard.
KeyT
t on a US keyboard.
KeyU
u on a US keyboard.
KeyV
v on a US keyboard.
KeyW
w on a US keyboard. Labeled z on an AZERTY (e.g., French) keyboard.
KeyX
x on a US keyboard.
KeyY
y on a US keyboard. Labeled z on a QWERTZ (e.g., German) keyboard.
KeyZ
z on a US keyboard. Labeled w on an AZERTY (e.g., French) keyboard, and y on a QWERTZ (e.g., German) keyboard.
Minus
- on a US keyboard.
Period
. on a US keyboard.
Quote
’ on a US keyboard.
Semicolon
; on a US keyboard.
Slash
/ on a US keyboard.
AltLeft
Alt, Option, or ⌥.
AltRight
Alt, Option, or ⌥. This is labeled AltGr on many keyboard layouts.
Backspace
Backspace or ⌫. Labeled Delete on Apple keyboards.
CapsLock
CapsLock or ⇪
ContextMenu
The application context menu key, which is typically found between the right Super key and the right Control key.
ControlLeft
Control or ⌃
ControlRight
Control or ⌃
Enter
Enter or ↵. Labeled Return on Apple keyboards.
SuperLeft
The Windows, ⌘, Command, or other OS symbol key.
SuperRight
The Windows, ⌘, Command, or other OS symbol key.
ShiftLeft
Shift or ⇧
ShiftRight
Shift or ⇧
Space
(space)
Tab
Tab or ⇥
Convert
Japanese: 変 (henkan)
KanaMode
Japanese: カタカナ/ひらがな/ローマ字 (katakana/hiragana/romaji)
Lang1
Korean: HangulMode 한/영 (han/yeong)
Japanese (Mac keyboard): か (kana)
Lang2
Korean: Hanja 한 (hanja)
Japanese (Mac keyboard): 英 (eisu)
Lang3
Japanese (word-processing keyboard): Katakana
Lang4
Japanese (word-processing keyboard): Hiragana
Lang5
Japanese (word-processing keyboard): Zenkaku/Hankaku
NonConvert
Japanese: 無変換 (muhenkan)
Delete
⌦. The forward delete key.
Note that on Apple keyboards, the key labelled Delete on the main part of
the keyboard is encoded as Backspace
.
End
Page Down, End, or ↘
Help
Help. Not present on standard PC keyboards.
Home
Home or ↖
Insert
Insert or Ins. Not present on Apple keyboards.
PageDown
Page Down, PgDn, or ⇟
PageUp
Page Up, PgUp, or ⇞
ArrowDown
↓
ArrowLeft
←
ArrowRight
→
ArrowUp
↑
NumLock
On the Mac, this is used for the numpad Clear key.
Numpad0
0 Ins on a keyboard. 0 on a phone or remote control
Numpad1
1 End on a keyboard. 1 or 1 QZ on a phone or remote control
Numpad2
2 ↓ on a keyboard. 2 ABC on a phone or remote control
Numpad3
3 PgDn on a keyboard. 3 DEF on a phone or remote control
Numpad4
4 ← on a keyboard. 4 GHI on a phone or remote control
Numpad5
5 on a keyboard. 5 JKL on a phone or remote control
Numpad6
6 → on a keyboard. 6 MNO on a phone or remote control
Numpad7
7 Home on a keyboard. 7 PQRS or 7 PRS on a phone or remote control
Numpad8
8 ↑ on a keyboard. 8 TUV on a phone or remote control
Numpad9
9 PgUp on a keyboard. 9 WXYZ or 9 WXY on a phone or remote control
NumpadAdd
+
NumpadBackspace
Found on the Microsoft Natural Keyboard.
NumpadClear
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
.
NumpadClearEntry
C (Clear Entry)
NumpadComma
, (thousands separator). For locales where the thousands separator is a “.” (e.g., Brazil), this key may generate a ..
NumpadDecimal
. Del. For locales where the decimal separator is “,” (e.g., Brazil), this key may generate a ,.
NumpadDivide
/
NumpadEnter
NumpadEqual
=
NumpadHash
# on a phone or remote control device. This key is typically found below the 9 key and to the right of the 0 key.
NumpadMemoryAdd
M Add current entry to the value stored in memory.
NumpadMemoryClear
M Clear the value stored in memory.
NumpadMemoryRecall
M Replace the current entry with the value stored in memory.
NumpadMemoryStore
M Replace the value stored in memory with the current entry.
NumpadMemorySubtract
M Subtract current entry from the value stored in memory.
NumpadMultiply
on a keyboard. For use with numpads that provide mathematical operations (+, - and /).
Use NumpadStar
for the * key on phones and remote controls.
NumpadParenLeft
( Found on the Microsoft Natural Keyboard.
NumpadParenRight
) Found on the Microsoft Natural Keyboard.
NumpadStar
* 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.
NumpadSubtract
-
Escape
Esc or ⎋
Fn
Fn This is typically a hardware key that does not generate a separate code.
FnLock
FLock or FnLock. Function Lock key. Found on the Microsoft Natural Keyboard.
PrintScreen
PrtScr SysRq or Print Screen
ScrollLock
Scroll Lock
Pause
Pause Break
BrowserBack
Some laptops place this key to the left of the ↑ key.
This also the “back” button (triangle) on Android.
BrowserFavorites
BrowserForward
Some laptops place this key to the right of the ↑ key.
BrowserHome
The “home” button on Android.
BrowserRefresh
BrowserSearch
BrowserStop
Eject
Eject or ⏏. This key is placed in the function section on some Apple keyboards.
LaunchApp1
Sometimes labelled My Computer on the keyboard
LaunchApp2
Sometimes labelled Calculator on the keyboard
LaunchMail
MediaPlayPause
MediaSelect
MediaStop
MediaTrackNext
MediaTrackPrevious
Power
This key is placed in the function section on some Apple keyboards, replacing the Eject key.
Sleep
AudioVolumeDown
AudioVolumeMute
AudioVolumeUp
WakeUp
Meta
Hyper
Turbo
Abort
Resume
Suspend
Again
Found on Sun’s USB keyboard.
Copy
Found on Sun’s USB keyboard.
Cut
Found on Sun’s USB keyboard.
Find
Found on Sun’s USB keyboard.
Open
Found on Sun’s USB keyboard.
Paste
Found on Sun’s USB keyboard.
Props
Found on Sun’s USB keyboard.
Select
Found on Sun’s USB keyboard.
Undo
Found on Sun’s USB keyboard.
Hiragana
Use for dedicated ひらがな key found on some Japanese word processing keyboards.
Katakana
Use for dedicated カタカナ key found on some Japanese word processing keyboards.
F1
General-purpose function key. Usually found at the top of the keyboard.
F2
General-purpose function key. Usually found at the top of the keyboard.
F3
General-purpose function key. Usually found at the top of the keyboard.
F4
General-purpose function key. Usually found at the top of the keyboard.
F5
General-purpose function key. Usually found at the top of the keyboard.
F6
General-purpose function key. Usually found at the top of the keyboard.
F7
General-purpose function key. Usually found at the top of the keyboard.
F8
General-purpose function key. Usually found at the top of the keyboard.
F9
General-purpose function key. Usually found at the top of the keyboard.
F10
General-purpose function key. Usually found at the top of the keyboard.
F11
General-purpose function key. Usually found at the top of the keyboard.
F12
General-purpose function key. Usually found at the top of the keyboard.
F13
General-purpose function key. Usually found at the top of the keyboard.
F14
General-purpose function key. Usually found at the top of the keyboard.
F15
General-purpose function key. Usually found at the top of the keyboard.
F16
General-purpose function key. Usually found at the top of the keyboard.
F17
General-purpose function key. Usually found at the top of the keyboard.
F18
General-purpose function key. Usually found at the top of the keyboard.
F19
General-purpose function key. Usually found at the top of the keyboard.
F20
General-purpose function key. Usually found at the top of the keyboard.
F21
General-purpose function key. Usually found at the top of the keyboard.
F22
General-purpose function key. Usually found at the top of the keyboard.
F23
General-purpose function key. Usually found at the top of the keyboard.
F24
General-purpose function key. Usually found at the top of the keyboard.
F25
General-purpose function key.
F26
General-purpose function key.
F27
General-purpose function key.
F28
General-purpose function key.
F29
General-purpose function key.
F30
General-purpose function key.
F31
General-purpose function key.
F32
General-purpose function key.
F33
General-purpose function key.
F34
General-purpose function key.
F35
General-purpose function key.
Trait Implementations§
source§impl Ord for Code
impl Ord for Code
source§impl PartialOrd for Code
impl PartialOrd for Code
impl Copy for Code
impl Eq for Code
impl StructuralPartialEq for Code
Auto Trait Implementations§
impl Freeze for Code
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnwindSafe for Code
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
source§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters
when converting.source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle
.source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other
into Self
, while performing the appropriate scaling,
rounding and clamping.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
source§fn into_angle(self) -> U
fn into_angle(self) -> U
T
.source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters
when converting.source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
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 moresource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self
into T
, while performing the appropriate scaling,
rounding and clamping.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors
fails to cast.source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more