Skip to main content

NonPrintableKey

Enum NonPrintableKey 

Source
#[repr(u32)]
pub enum NonPrintableKey {
Show 59 variants Unidentified = 0, Alt = 17, AltGraph = 18, CapsLock = 19, Control = 20, Fn = 21, FnLock = 22, Meta = 23, NumLock = 24, ScrollLock = 25, Shift = 26, Symbol = 27, SymbolLock = 28, Hyper = 29, Super = 30, Enter = 49, Tab = 50, Backspace = 65, Down = 97, Left = 98, Right = 99, Up = 100, End = 101, Home = 102, PageDown = 103, PageUp = 104, Escape = 24_581, Select = 24_588, BrightnessDown = 28_672, BrightnessUp = 28_673, F1 = 36_865, F2 = 36_866, F3 = 36_867, F4 = 36_868, F5 = 36_869, F6 = 36_870, F7 = 36_871, F8 = 36_872, F9 = 36_873, F10 = 36_874, F11 = 36_875, F12 = 36_876, Soft1 = 36_881, Soft2 = 36_882, Soft3 = 36_883, Soft4 = 36_884, MediaPlayPause = 40_968, AudioVolumeDown = 49_162, AudioVolumeUp = 49_163, AudioVolumeMute = 49_164, BrowserBack = 61_440, BrowserFavorites = 61_441, BrowserForward = 61_442, BrowserHome = 61_443, BrowserRefresh = 61_444, BrowserSearch = 61_445, BrowserStop = 61_446, ZoomToggle = 73_799, UnknownOrdinal_(u32),
}
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 = 0

§

Alt = 17

§

AltGraph = 18

§

CapsLock = 19

§

Control = 20

§

Fn = 21

§

FnLock = 22

§

Meta = 23

§

NumLock = 24

§

ScrollLock = 25

§

Shift = 26

§

Symbol = 27

§

SymbolLock = 28

§

Hyper = 29

§

Super = 30

§

Enter = 49

§

Tab = 50

§

Backspace = 65

§

Down = 97

§

Left = 98

§

Right = 99

§

Up = 100

§

End = 101

§

Home = 102

§

PageDown = 103

§

PageUp = 104

§

Escape = 24_581

§

Select = 24_588

§

BrightnessDown = 28_672

§

BrightnessUp = 28_673

§

F1 = 36_865

§

F2 = 36_866

§

F3 = 36_867

§

F4 = 36_868

§

F5 = 36_869

§

F6 = 36_870

§

F7 = 36_871

§

F8 = 36_872

§

F9 = 36_873

§

F10 = 36_874

§

F11 = 36_875

§

F12 = 36_876

§

Soft1 = 36_881

§

Soft2 = 36_882

§

Soft3 = 36_883

§

Soft4 = 36_884

§

MediaPlayPause = 40_968

§

AudioVolumeDown = 49_162

§

AudioVolumeUp = 49_163

§

AudioVolumeMute = 49_164

§

BrowserBack = 61_440

§

BrowserFavorites = 61_441

§

BrowserForward = 61_442

§

BrowserHome = 61_443

§

BrowserRefresh = 61_444

§

BrowserSearch = 61_445

§

BrowserStop = 61_446

§

ZoomToggle = 73_799

§

UnknownOrdinal_(u32)

Trait Implementations§

Source§

impl Clone for NonPrintableKey

Source§

fn clone(&self) -> NonPrintableKey

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for NonPrintableKey

Source§

impl Debug for NonPrintableKey

Source§

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

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

impl<___E> Encode<NonPrintableKey, ___E> for NonPrintableKey
where ___E: ?Sized,

Source§

fn encode( self, encoder: &mut ___E, out: &mut MaybeUninit<NonPrintableKey>, _: (), ) -> Result<(), EncodeError>

Encodes this value into an encoder and output.
§

const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _

Whether the conversion from Self to W is equivalent to copying the raw bytes of Self. Read more
Source§

impl<'a, ___E> Encode<NonPrintableKey, ___E> for &'a NonPrintableKey
where ___E: ?Sized,

Source§

fn encode( self, encoder: &mut ___E, out: &mut MaybeUninit<NonPrintableKey>, _: (), ) -> Result<(), EncodeError>

Encodes this value into an encoder and output.
§

const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _

Whether the conversion from Self to W is equivalent to copying the raw bytes of Self. Read more
Source§

impl Eq for NonPrintableKey

Source§

impl From<NonPrintableKey> for NonPrintableKey

Source§

fn from(wire: NonPrintableKey) -> NonPrintableKey

Converts to this type from the input type.
Source§

impl From<NonPrintableKey> for NonPrintableKey

Source§

fn from(natural: NonPrintableKey) -> NonPrintableKey

Converts to this type from the input type.
Source§

impl From<u32> for NonPrintableKey

Source§

fn from(value: u32) -> NonPrintableKey

Converts to this type from the input type.
Source§

impl FromWire<NonPrintableKey> for NonPrintableKey

Source§

fn from_wire(wire: NonPrintableKey) -> NonPrintableKey

Converts the given owned value to this type.
§

const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _

Whether the conversion from W to Self is equivalent to copying the raw bytes of W. Read more
Source§

impl FromWireRef<NonPrintableKey> for NonPrintableKey

Source§

fn from_wire_ref(wire: &NonPrintableKey) -> NonPrintableKey

Converts the given reference to this type.
Source§

impl Hash for NonPrintableKey

Source§

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

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 (const: unstable) · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

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

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

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for NonPrintableKey

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 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
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> FromWireOption<Box<'_, W>> for T
where T: FromWire<W>,

§

fn from_wire_option(wire: Box<'_, W>) -> Option<T>

Converts the given owned value to an option of this type.
§

impl<T, W> FromWireOptionRef<Box<'_, W>> for T
where T: FromWireRef<W>,

§

fn from_wire_option_ref(wire: &Box<'_, W>) -> Option<T>

Converts the given reference to an option of this type.
§

impl<T> InstanceFromServiceTransport<T> for T

§

fn from_service_transport(handle: T) -> T

Converts the given service transport handle of type T to [Self]
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
§

impl<E> RunsTransport<Mpsc> for E

§

impl<E> RunsTransport<Mpsc> for E
where E: RunsTransport<Mpsc>,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.