pub enum Key {
Show 202 variants
Unknown,
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,
Key1,
Key2,
Key3,
Key4,
Key5,
Key6,
Key7,
Key8,
Key9,
Key0,
Enter,
Escape,
Backspace,
Tab,
Space,
Minus,
Equals,
LeftBrace,
RightBrace,
Backslash,
NonUsHash,
Semicolon,
Apostrophe,
GraveAccent,
Comma,
Dot,
Slash,
CapsLock,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
PrintScreen,
ScrollLock,
Pause,
Insert,
Home,
PageUp,
Delete,
End,
PageDown,
Right,
Left,
Down,
Up,
NumLock,
KeypadSlash,
KeypadAsterisk,
KeypadMinus,
KeypadPlus,
KeypadEnter,
Keypad1,
Keypad2,
Keypad3,
Keypad4,
Keypad5,
Keypad6,
Keypad7,
Keypad8,
Keypad9,
Keypad0,
KeypadDot,
NonUsBackslash,
KeypadEquals,
Menu,
LeftCtrl,
LeftShift,
LeftAlt,
LeftMeta,
RightCtrl,
RightShift,
RightAlt,
RightMeta,
Mute,
VolumeDown,
VolumeUp,
PlayPause,
MediaMute,
MediaVolumeIncrement,
MediaVolumeDecrement,
AcBack,
AcRefresh,
AcFullScreenView,
AcSelectTaskApplication,
BrightnessDown,
BrightnessUp,
Assistant,
Power,
Unknown0055,
Unknown0056,
Unknown0059,
Unknown005C,
Unknown005D,
Unknown005E,
Unknown0079,
Unknown007A,
Unknown007B,
Unknown007C,
Unknown0085,
Unknown0087,
Unknown0089,
Unknown009C,
Unknown009F,
Unknown00A0,
Unknown00A2,
Unknown00A3,
Unknown00A5,
Unknown00A6,
Unknown00A7,
Unknown00A8,
Unknown00A9,
Unknown00Ad,
Unknown00B1,
Unknown00B2,
Unknown00B3,
Unknown00B4,
Unknown00C9,
Unknown00Cf,
Unknown00D0,
Unknown00D4,
Unknown00E2,
Unknown0120,
Unknown0121,
Unknown0122,
Unknown0123,
Unknown0124,
Unknown0125,
Unknown0126,
Unknown0127,
Unknown0128,
Unknown0129,
Unknown012A,
Unknown012B,
Unknown012C,
Unknown012D,
Unknown012E,
Unknown012F,
Unknown0130,
Unknown0131,
Unknown0132,
Unknown0133,
Unknown0134,
Unknown0135,
Unknown0136,
Unknown0137,
Unknown0138,
Unknown0139,
Unknown013A,
Unknown013B,
Unknown013C,
Unknown013D,
Unknown013E,
Unknown0161,
Unknown016A,
Unknown016E,
Unknown0172,
Unknown0179,
Unknown018E,
Unknown018F,
Unknown0190,
Unknown0191,
Unknown0192,
Unknown0193,
Unknown0195,
Unknown01D0,
Unknown020A,
Unknown020B,
// some variants omitted
}
Expand description
A Fuchsia key represents a control that can be pressed or released such as a key or a button on a keyboard or another input device.
The ordinal index for enum elements is derived from the USB HID Usage Tables at the time of definition. It is a 32 bit unsigned integer representing the USB HID Usage where the low 16 bits are the USB HID Usage ID and the high 16 bits are the USB HID Usage Page.
The descriptions for each value in the enum assume a US English keyboard layout. Actual behavior varies by layout.
Variants§
Unknown
Used when the value of Key is not known.
A
Keyboard a and A
B
Keyboard b and B
C
Keyboard c and C
D
Keyboard d and D
E
Keyboard e and E
F
Keyboard f and F
G
Keyboard g and G
H
Keyboard h and H
I
Keyboard i and I
J
Keyboard j and J
K
Keyboard k and K
L
Keyboard l and L
M
Keyboard m and M
N
Keyboard n and N
O
Keyboard o and O
P
Keyboard p and P
Q
Keyboard q and Q
R
Keyboard r and R
S
Keyboard s and S
T
Keyboard t and T
U
Keyboard u and U
V
Keyboard v and V
W
Keyboard w and W
X
Keyboard x and X
Y
Keyboard y and Y
Z
Keyboard z and Z
Key1
Keyboard 1 and !
Key2
Keyboard 2 and @
Key3
Keyboard 3 and #
Key4
Keyboard 4 and $
Key5
Keyboard 5 and %
Key6
Keyboard 6 and ^
Key7
Keyboard 7 and &
Key8
Keyboard 8 and *
Key9
Keyboard 9 and (
Key0
Keyboard 0 and )
Enter
Keyboard Enter (Return)
Escape
Keyboard Escape
Backspace
Keyboard Backspace (Backward Delete)
Tab
Keyboard Tab
Space
Keyboard Spacebar
Minus
Keyboard - and (underscore)
Equals
Keyboard = and +
LeftBrace
Keyboard [ and {
RightBrace
Keyboard ] and }
Backslash
Keyboard \ and |
NonUsHash
Keyboard Non-US # and ~
Semicolon
Keyboard ; and :
Apostrophe
Keyboard ’ and “
GraveAccent
Keyboard Grave Accent and Tilde
Comma
Keyboard , and <
Dot
Keyboard . and >
Slash
Keyboard / and ?
CapsLock
Keyboard Caps Lock
F1
Keyboard F1
F2
Keyboard F2
F3
Keyboard F3
F4
Keyboard F4
F5
Keyboard F5
F6
Keyboard F6
F7
Keyboard F7
F8
Keyboard F8
F9
Keyboard F9
F10
Keyboard F10
F11
Keyboard F11
F12
Keyboard F12
PrintScreen
Keyboard Print Screen
ScrollLock
Keyboard Scroll Lock
Pause
Keyboard Pause
Insert
Keyboard Insert
Home
Keyboard Home
PageUp
Keyboard Page Up
Delete
Keyboard Forward Delete
End
Keyboard End
PageDown
Keyboard Page Down
Right
Keyboard Right Arrow
Left
Keyboard Left Arrow
Down
Keyboard Down Arrow
Up
Keyboard Up Arrow
NumLock
Keypad Num Lock and Clear
KeypadSlash
Keypad /
KeypadAsterisk
Keypad *
KeypadMinus
Keypad -
KeypadPlus
Keypad +
KeypadEnter
Keypad ENTER
Keypad1
Keypad 1 and End
Keypad2
Keypad 2 and Down Arrow
Keypad3
Keypad 3 and Page Down
Keypad4
Keypad 4 and Left Arrow
Keypad5
Keypad 5
Keypad6
Keypad 6 and Right Arrow
Keypad7
Keypad 7 and Home
Keypad8
Keypad 8 and Up Arrow
Keypad9
Keypad 9 and Page Up
Keypad0
Keypad 0 and Insert
KeypadDot
Keypad . and Delete
NonUsBackslash
Keyboard Non-US \ and |
KeypadEquals
Keypad =
Menu
Keyboard Menu
LeftCtrl
Keyboard Left Control
LeftShift
Keyboard Left Shift
LeftAlt
Keyboard Left Alt
LeftMeta
Keyboard Left GUI (Meta, Windows)
RightCtrl
Keyboard Right Control
RightShift
Keyboard Right Shift
RightAlt
Keyboard Right Alt
RightMeta
Keyboard Right GUI (Meta, Windows)
Mute
Mute
Silences played sounds.
VolumeDown
Turn volume down
VolumeUp
Turn volume up
PlayPause
Play media, or pause media if playing
MediaMute
Media mute
Silences media playback. Other sounds may still be heard, e.g. system notification sounds.
MediaVolumeIncrement
Volume Increment
MediaVolumeDecrement
Volume Decrement
AcBack
Back
Go back to the previous page in the browser. This, and other action keys are defined in Chromium.
AcRefresh
Refresh
Refresh the current page in the browser.
AcFullScreenView
Full screen view
Zooms the focused window to full screen.
AcSelectTaskApplication
Select task/application
Shows the task selection window
BrightnessDown
Reduce screen brightness
BrightnessUp
Increase screen brightness
Assistant
NOTE: the following are self-defined and do not have to follow the HID usage pages. We use HID-Vendor-Specific page 0xFFFF to represent Fuchsia defined keys. Assistant Key.
Power
Power Button.
Unknown0055
Warning: following keycodes maybe changed in the future, please don’t use!!! We use following keycodes in starnix tests. Most of them are keycodes in non-US keyboard layouts, we may move them to meaning enum once we support those keyboard layouts. See b/311425670 for details.
Unknown0056
Unknown0059
Unknown005C
Unknown005D
Unknown005E
Unknown0079
Unknown007A
Unknown007B
Unknown007C
Unknown0085
Unknown0087
Unknown0089
Unknown009C
Unknown009F
Unknown00A0
Unknown00A2
Unknown00A3
Unknown00A5
Unknown00A6
Unknown00A7
Unknown00A8
Unknown00A9
Unknown00Ad
Unknown00B1
Unknown00B2
Unknown00B3
Unknown00B4
Unknown00C9
Unknown00Cf
Unknown00D0
Unknown00D4
Unknown00E2
Unknown0120
Unknown0121
Unknown0122
Unknown0123
Unknown0124
Unknown0125
Unknown0126
Unknown0127
Unknown0128
Unknown0129
Unknown012A
Unknown012B
Unknown012C
Unknown012D
Unknown012E
Unknown012F
Unknown0130
Unknown0131
Unknown0132
Unknown0133
Unknown0134
Unknown0135
Unknown0136
Unknown0137
Unknown0138
Unknown0139
Unknown013A
Unknown013B
Unknown013C
Unknown013D
Unknown013E
Unknown0161
Unknown016A
Unknown016E
Unknown0172
Unknown0179
Unknown018E
Unknown018F
Unknown0190
Unknown0191
Unknown0192
Unknown0193
Unknown0195
Unknown01D0
Unknown020A
Unknown020B
Implementations§
Source§impl Key
impl Key
pub fn from_primitive(prim: u32) -> Option<Self>
pub fn from_primitive_allow_unknown(prim: u32) -> Self
pub fn unknown() -> Self
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl<D: ResourceDialect> Decode<Key, D> for Key
impl<D: ResourceDialect> Decode<Key, D> for Key
Source§impl Ord for Key
impl Ord for Key
Source§impl PartialOrd for Key
impl PartialOrd for Key
Source§impl TypeMarker for Key
impl TypeMarker for Key
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for Key
impl ValueTypeMarker for Key
impl Copy for Key
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)