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
impl NonPrintableKey
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 Clone for NonPrintableKey
impl Clone for NonPrintableKey
Source§fn clone(&self) -> NonPrintableKey
fn clone(&self) -> NonPrintableKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for NonPrintableKey
impl Debug for NonPrintableKey
Source§impl<D: ResourceDialect> Decode<NonPrintableKey, D> for NonPrintableKey
impl<D: ResourceDialect> Decode<NonPrintableKey, D> for NonPrintableKey
Source§impl<D: ResourceDialect> Encode<NonPrintableKey, D> for NonPrintableKey
impl<D: ResourceDialect> Encode<NonPrintableKey, D> for NonPrintableKey
Source§impl Hash for NonPrintableKey
impl Hash for NonPrintableKey
Source§impl Ord for NonPrintableKey
impl Ord for NonPrintableKey
Source§fn cmp(&self, other: &NonPrintableKey) -> Ordering
fn cmp(&self, other: &NonPrintableKey) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for NonPrintableKey
impl PartialEq for NonPrintableKey
Source§impl PartialOrd for NonPrintableKey
impl PartialOrd for NonPrintableKey
Source§impl TypeMarker for NonPrintableKey
impl TypeMarker for NonPrintableKey
Source§type Owned = NonPrintableKey
type Owned = NonPrintableKey
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 NonPrintableKey
impl ValueTypeMarker for NonPrintableKey
Source§type Borrowed<'a> = NonPrintableKey
type Borrowed<'a> = NonPrintableKey
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for NonPrintableKey
impl Eq for NonPrintableKey
impl StructuralPartialEq for NonPrintableKey
Auto Trait Implementations§
impl Freeze for NonPrintableKey
impl RefUnwindSafe for NonPrintableKey
impl Send for NonPrintableKey
impl Sync for NonPrintableKey
impl Unpin for NonPrintableKey
impl UnwindSafe for NonPrintableKey
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
)