fidl_fuchsia_input

Enum Key

Source
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

Source

pub fn from_primitive(prim: u32) -> Option<Self>

Source

pub fn from_primitive_allow_unknown(prim: u32) -> Self

Source

pub fn unknown() -> Self

Source

pub const fn into_primitive(self) -> u32

Source

pub fn is_unknown(&self) -> bool

Trait Implementations§

Source§

impl Clone for Key

Source§

fn clone(&self) -> Key

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Key

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<D: ResourceDialect> Decode<Key, D> for Key

Source§

fn new_empty() -> Self

Creates a valid instance of Self. The specific value does not matter, since it will be overwritten by decode.
Source§

unsafe fn decode( &mut self, decoder: &mut Decoder<'_, D>, offset: usize, _depth: Depth, ) -> Result<()>

Decodes an object of type T from the decoder’s buffers into self. Read more
Source§

impl<D: ResourceDialect> Encode<Key, D> for Key

Source§

unsafe fn encode( self, encoder: &mut Encoder<'_, D>, offset: usize, _depth: Depth, ) -> Result<()>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl Hash for Key

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Key

Source§

fn cmp(&self, other: &Key) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Key

Source§

fn eq(&self, other: &Key) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Key

Source§

fn partial_cmp(&self, other: &Key) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TypeMarker for Key

Source§

type Owned = Key

The owned Rust type which this FIDL type decodes into.
Source§

fn inline_align(_context: Context) -> usize

Returns the minimum required alignment of the inline portion of the encoded object. It must be a (nonzero) power of two.
Source§

fn inline_size(_context: Context) -> usize

Returns the size of the inline portion of the encoded object, including padding for alignment. Must be a multiple of inline_align.
Source§

fn encode_is_copy() -> bool

Returns true if the memory layout of 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 more
Source§

fn decode_is_copy() -> bool

Returns true if the memory layout of 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

Source§

type Borrowed<'a> = Key

The Rust type to use for encoding. This is a particular Encode<Self> type cheaply obtainable from &Self::Owned. There are three cases: Read more
Source§

fn borrow(value: &<Self as TypeMarker>::Owned) -> Self::Borrowed<'_>

Cheaply converts from &Self::Owned to Self::Borrowed.
Source§

impl Copy for Key

Source§

impl Eq for Key

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<E> ErrorType for E
where E: ValueTypeMarker<Owned = E> + Decode<E, DefaultFuchsiaResourceDialect>,

§

type Marker = E

The marker type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more