pub enum NonPrintableKey {
Show 58 variants Unidentified, Alt, AltGraph, CapsLock, Control, Fn, FnLock, Meta, NumLock, ScrollLock, Shift, Symbol, SymbolLock, Hyper, Super, Enter, Tab, Backspace, Down, Left, Right, Up, End, Home, PageDown, PageUp, Escape, Select, BrightnessDown, BrightnessUp, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, Soft1, Soft2, Soft3, Soft4, MediaPlayPause, AudioVolumeDown, AudioVolumeUp, AudioVolumeMute, BrowserBack, BrowserFavorites, BrowserForward, BrowserHome, BrowserRefresh, BrowserSearch, BrowserStop, ZoomToggle, // some variants omitted
}
Expand description

NonPrintableKey represents the meaning of a non-symbolic key on a keyboard.

The definition of each key is derived from W3C named values of a key attribute.

§API version 9 and onwards

Starting from API version 9, the enum value space is subdivided based on the subsection numbers of the section Named Key Attribute Values, multiplied by 0x1000.

For example, the keys from section 3.10 Multimedia keys will be located at 0xa000-0xafff. The values and reservations that were present in this enum prior to the introduction of the convention have not been moved, and values that go logically into pre-existing sections have been inserted into their logical place using the prior convention (see below). This allows us to extract the section ranges if this is for some reason useful to the application.

§Prior to API version 9

The space of the nonprintable keys is subdivided roughly to correspond to the subsections of Section 3 of the document Named Key Attribute Values. The choice for the section values is arbitrary, so long as blocks of values are allocated at once, and the keys with similar purpose are kept together.

§Reserved ranges

The space of possible values for NonPrintableKey is subdivided into a number of ranges, with the intention that the enum values are placed in the appropriate range when added.

  • Special keys: 0x00-0x10
  • Modifier keys: 0x11-0x30
  • Whitespace keys: 0x31-0x40
  • Navigation keys: 0x61-0x80
  • General-purpose function keys: 0x9000-0x9FFF

Variants§

§

Unidentified

This key value is used when an implementation is unable to identify another key value, due to either hardware, platform, or software constraints.

§

Alt

The Alt (Alternative) key.

This key enables the alternate modifier function for interpreting concurrent or subsequent keyboard input. This key value is also used for the Apple Option key.

§

AltGraph

The Alternate Graphics (AltGr or AltGraph).

This key is used enable the ISO Level 3 shift modifier (the standard Shift key is the level 2 modifier). See ISO9995-1.

§

CapsLock

The Caps Lock (Capital) key.

Toggle capital character lock function for interpreting subsequent keyboard input event.

§

Control

The Control or Ctrl key, to enable control modifier function for interpreting concurrent or subsequent keyboard input.

§

Fn

The Function switch Fn key.

Activating this key simultaneously with another key changes that key’s value to an alternate character or function. This key is often handled directly in the keyboard hardware and does not usually generate key events.

§

FnLock

The Function-Lock (FnLock or F-Lock) key.

Activating this key switches the mode of the keyboard to changes some keys’ values to an alternate character or function. This key is often handled directly in the keyboard hardware and does not usually generate key events.

§

Meta

The Meta key, to enable meta modifier function for interpreting concurrent or subsequent keyboard input.

This key value is used for the Windows Logo key and the Apple Command or ⌘ key.

§

NumLock

The NumLock or Number Lock key, to toggle numpad mode function for interpreting subsequent keyboard input.

§

ScrollLock

The Scroll Lock key, to toggle between scrolling and cursor movement modes.

§

Shift

The Shift key, to enable shift modifier function for interpreting concurrent or subsequent keyboard input.

§

Symbol

The Symbol modifier key (used on some virtual keyboards).

§

SymbolLock

The Symbol Lock key.

§

Hyper

The Hyper key. A legacy modifier.

§

Super

The Super key. A legacy modifier.

§

Enter

The Enter or ↵ key, to activate current selection or accept current input. This key value is also used for the Return (Macintosh numpad) key.

§

Tab

The Horizontal Tabulation Tab key.

§

Backspace

Delete the character immediately preceding the cursor (i.e. the character to the left for LTR languages).

§

Down

The down arrow navigation key.

§

Left

The left arrow navigation key.

§

Right

The right arrow navigation key.

§

Up

The up arrow navigation key.

§

End

The “End” key.

§

Home

The “Home” key.

§

PageDown

The “Page Down” key.

§

PageUp

The “Page Up” key.

§

Escape

The Escape or Esc key.

§

Select

The Select key. Used to select the window of a task to focus on.

§

BrightnessDown

The Brightness Down key. Typically controls the display brightness.

§

BrightnessUp

The Brightness Up key. Typically controls the display brightness.

§

F1

The F1 key, a general purpose function key, as index 1.

§

F2

The F2 key, a general purpose function key, as index 2.

§

F3

The F3 key, a general purpose function key, as index 3.

§

F4

The F4 key, a general purpose function key, as index 4.

§

F5

The F5 key, a general purpose function key, as index 5.

§

F6

The F6 key, a general purpose function key, as index 6.

§

F7

The F7 key, a general purpose function key, as index 7.

§

F8

The F8 key, a general purpose function key, as index 8.

§

F9

The F9 key, a general purpose function key, as index 9.

§

F10

The F10 key, a general purpose function key, as index 10.

§

F11

The F11 key, a general purpose function key, as index 11.

§

F12

The F1 key, a general purpose function key, as index 12.

§

Soft1

General purpose virtual function key, as index 1.

§

Soft2

General purpose virtual function key, as index 2.

§

Soft3

General purpose virtual function key, as index 3.

§

Soft4

General purpose virtual function key, as index 4.

§

MediaPlayPause

Pause the currently playing media.

NOTE: Media controller devices should use this value rather than PAUSE for their pause keys.

§

AudioVolumeDown

Decrease audio volume.

§

AudioVolumeUp

Increase audio volume.

§

AudioVolumeMute

Toggle between muted state and prior volume level.

§

BrowserBack

Navigate to previous content or page in current history.

§

BrowserFavorites

Open the list of browser favorites.

§

BrowserForward

Navigate to next content or page in current history.

§

BrowserHome

Go to the user’s preferred home page.

§

BrowserRefresh

Refresh the current page or content.

§

BrowserSearch

Call up the user’s preferred search page.

§

BrowserStop

§

ZoomToggle

Toggle between full-screen and scaled content, or alter magnification level.

Implementations§

source§

impl NonPrintableKey

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 NonPrintableKey

source§

fn clone(&self) -> NonPrintableKey

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 NonPrintableKey

source§

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

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

impl Decode<NonPrintableKey> for NonPrintableKey

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<'_>, offset: usize, _depth: Depth ) -> Result<()>

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

impl Encode<NonPrintableKey> for NonPrintableKey

source§

unsafe fn encode( self, encoder: &mut Encoder<'_>, 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 NonPrintableKey

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 NonPrintableKey

source§

fn cmp(&self, other: &NonPrintableKey) -> 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 + PartialOrd,

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

impl PartialEq for NonPrintableKey

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for NonPrintableKey

source§

fn partial_cmp(&self, other: &NonPrintableKey) -> 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

This method 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

This method 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

This method 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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl TypeMarker for NonPrintableKey

§

type Owned = NonPrintableKey

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 NonPrintableKey

§

type Borrowed<'a> = NonPrintableKey

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<'a>(value: &'a <Self as TypeMarker>::Owned) -> Self::Borrowed<'a>

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

impl Copy for NonPrintableKey

source§

impl Eq for NonPrintableKey

source§

impl StructuralPartialEq for NonPrintableKey

Auto Trait Implementations§

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
§

impl<T> Encode<Ambiguous1> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _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> Encode<Ambiguous2> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _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>,

§

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,

§

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>,

§

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>,

§

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