Skip to main content

PhysicalKeyCode

Enum PhysicalKeyCode 

Source
#[non_exhaustive]
pub enum PhysicalKeyCode {
Show 108 variants KeyW, KeyA, KeyS, KeyD, Enter, Space, ArrowLeft, ArrowRight, ArrowDown, ArrowUp, Escape, KeyP, KeyR, KeyN, Digit1, Digit2, Digit3, Digit4, Digit5, F3, F4, F5, F6, F8, F9, KeyL, KeyF, KeyM, KeyT, KeyV, Digit6, Digit7, Digit8, Digit9, F7, KeyE, ShiftLeft, Tab, Digit0, F1, F2, F10, F11, F12, ShiftRight, ControlLeft, ControlRight, AltLeft, AltRight, SuperLeft, SuperRight, Backspace, Delete, Insert, Home, End, PageUp, PageDown, CapsLock, NumLock, ScrollLock, PrintScreen, Pause, ContextMenu, Backquote, Minus, Equal, BracketLeft, BracketRight, Backslash, Semicolon, Quote, Comma, Period, Slash, KeyB, KeyC, KeyG, KeyH, KeyI, KeyJ, KeyK, KeyO, KeyU, KeyX, KeyY, KeyZ, Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Numpad7, Numpad8, Numpad9, NumpadEnter, NumpadAdd, NumpadSubtract, NumpadMultiply, NumpadDivide, NumpadDecimal, NumpadEqual, IntlBackslash, IntlRo, IntlYen, KeyQ,
}
Expand description

A portable physical keyboard key supported by the runtime.

Desktop adapters translate platform key codes into this enum before input reaches the headless runtime core.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

KeyW

The physical W key.

§

KeyA

The physical A key.

§

KeyS

The physical S key.

§

KeyD

The physical D key.

§

Enter

The main Enter key.

§

Space

The physical Space key.

§

ArrowLeft

The physical left-arrow key.

§

ArrowRight

The physical right-arrow key.

§

ArrowDown

The physical down-arrow key.

§

ArrowUp

The physical up-arrow key.

§

Escape

The physical Escape key.

§

KeyP

The physical P key.

§

KeyR

The physical R key.

§

KeyN

The physical N key.

§

Digit1

The physical 1 key on the number row, not the numeric keypad.

§

Digit2

The physical 2 key on the number row, not the numeric keypad.

§

Digit3

The physical 3 key on the number row, not the numeric keypad.

§

Digit4

The physical 4 key on the number row, not the numeric keypad.

§

Digit5

The physical 5 key on the number row, not the numeric keypad.

§

F3

The physical F3 function key.

§

F4

The physical F4 function key.

§

F5

The physical F5 function key.

§

F6

The physical F6 function key.

§

F8

The physical F8 function key.

§

F9

The physical F9 function key.

§

KeyL

The physical L key.

§

KeyF

The physical F key.

§

KeyM

The physical M key.

§

KeyT

The physical T key.

§

KeyV

The physical V key.

§

Digit6

The physical 6 key on the number row.

§

Digit7

The physical 7 key on the number row.

§

Digit8

The physical 8 key on the number row.

§

Digit9

The physical 9 key on the number row.

§

F7

The physical F7 function key.

§

KeyE

The physical E key.

§

ShiftLeft

The physical left Shift key.

§

Tab

The physical Tab key (independent of keyboard layout).

§

Digit0

The physical Digit0 key (independent of keyboard layout).

§

F1

The physical F1 key (independent of keyboard layout).

§

F2

The physical F2 key (independent of keyboard layout).

§

F10

The physical F10 key (independent of keyboard layout).

§

F11

The physical F11 key (independent of keyboard layout).

§

F12

The physical F12 key (independent of keyboard layout).

§

ShiftRight

The physical ShiftRight key (independent of keyboard layout).

§

ControlLeft

The physical ControlLeft key (independent of keyboard layout).

§

ControlRight

The physical ControlRight key (independent of keyboard layout).

§

AltLeft

The physical AltLeft key (independent of keyboard layout).

§

AltRight

The physical AltRight key (independent of keyboard layout).

§

SuperLeft

The physical SuperLeft key (independent of keyboard layout).

§

SuperRight

The physical SuperRight key (independent of keyboard layout).

§

Backspace

The physical Backspace key (independent of keyboard layout).

§

Delete

The physical Delete key (independent of keyboard layout).

§

Insert

The physical Insert key (independent of keyboard layout).

§

Home

The physical Home key (independent of keyboard layout).

§

End

The physical End key (independent of keyboard layout).

§

PageUp

The physical PageUp key (independent of keyboard layout).

§

PageDown

The physical PageDown key (independent of keyboard layout).

§

CapsLock

The physical CapsLock key (independent of keyboard layout).

§

NumLock

The physical NumLock key (independent of keyboard layout).

§

ScrollLock

The physical ScrollLock key (independent of keyboard layout).

§

PrintScreen

The physical PrintScreen key (independent of keyboard layout).

§

Pause

The physical Pause key (independent of keyboard layout).

§

ContextMenu

The physical ContextMenu key (independent of keyboard layout).

§

Backquote

The physical Backquote key (independent of keyboard layout).

§

Minus

The physical Minus key (independent of keyboard layout).

§

Equal

The physical Equal key (independent of keyboard layout).

§

BracketLeft

The physical BracketLeft key (independent of keyboard layout).

§

BracketRight

The physical BracketRight key (independent of keyboard layout).

§

Backslash

The physical Backslash key (independent of keyboard layout).

§

Semicolon

The physical Semicolon key (independent of keyboard layout).

§

Quote

The physical Quote key (independent of keyboard layout).

§

Comma

The physical Comma key (independent of keyboard layout).

§

Period

The physical Period key (independent of keyboard layout).

§

Slash

The physical Slash key (independent of keyboard layout).

§

KeyB

The physical KeyB key (independent of keyboard layout).

§

KeyC

The physical KeyC key (independent of keyboard layout).

§

KeyG

The physical KeyG key (independent of keyboard layout).

§

KeyH

The physical KeyH key (independent of keyboard layout).

§

KeyI

The physical KeyI key (independent of keyboard layout).

§

KeyJ

The physical KeyJ key (independent of keyboard layout).

§

KeyK

The physical KeyK key (independent of keyboard layout).

§

KeyO

The physical KeyO key (independent of keyboard layout).

§

KeyU

The physical KeyU key (independent of keyboard layout).

§

KeyX

The physical KeyX key (independent of keyboard layout).

§

KeyY

The physical KeyY key (independent of keyboard layout).

§

KeyZ

The physical KeyZ key (independent of keyboard layout).

§

Numpad0

The physical Numpad0 key (independent of keyboard layout).

§

Numpad1

The physical Numpad1 key (independent of keyboard layout).

§

Numpad2

The physical Numpad2 key (independent of keyboard layout).

§

Numpad3

The physical Numpad3 key (independent of keyboard layout).

§

Numpad4

The physical Numpad4 key (independent of keyboard layout).

§

Numpad5

The physical Numpad5 key (independent of keyboard layout).

§

Numpad6

The physical Numpad6 key (independent of keyboard layout).

§

Numpad7

The physical Numpad7 key (independent of keyboard layout).

§

Numpad8

The physical Numpad8 key (independent of keyboard layout).

§

Numpad9

The physical Numpad9 key (independent of keyboard layout).

§

NumpadEnter

The physical NumpadEnter key (independent of keyboard layout).

§

NumpadAdd

The physical NumpadAdd key (independent of keyboard layout).

§

NumpadSubtract

The physical NumpadSubtract key (independent of keyboard layout).

§

NumpadMultiply

The physical NumpadMultiply key (independent of keyboard layout).

§

NumpadDivide

The physical NumpadDivide key (independent of keyboard layout).

§

NumpadDecimal

The physical NumpadDecimal key (independent of keyboard layout).

§

NumpadEqual

The physical NumpadEqual key (independent of keyboard layout).

§

IntlBackslash

The physical IntlBackslash key (independent of keyboard layout).

§

IntlRo

The physical IntlRo key (independent of keyboard layout).

§

IntlYen

The physical IntlYen key (independent of keyboard layout).

§

KeyQ

The physical Q key, independent of keyboard layout.

Trait Implementations§

Source§

impl Clone for PhysicalKeyCode

Source§

fn clone(&self) -> Self

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 PhysicalKeyCode

Source§

impl Debug for PhysicalKeyCode

Source§

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

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

impl Eq for PhysicalKeyCode

Source§

impl Hash for PhysicalKeyCode

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 PartialEq for PhysicalKeyCode

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PhysicalKeyCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Action for T
where T: Copy + Eq + Hash + Send + Sync + 'static,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> ConditionalSend for T
where T: Send,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> DynEq for T
where T: Any + Eq,

Source§

fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool

This method tests for self and other values to be equal. Read more
Source§

impl<T> DynHash for T
where T: DynEq + Hash,

Source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Feeds this value into the given Hasher.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

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

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

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.

Source§

impl<T> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> WorldEvent for T
where T: Copy + Send + Sync + 'static,