Skip to main content

Key

Enum Key 

Source
#[non_exhaustive]
#[repr(i32)]
pub enum Key {
Show 133 variants None = 0, Back = 2, Tab = 3, Return = 6, Pause = 7, CapsLock = 8, Escape = 13, Space = 18, PageUp = 19, PageDown = 20, End = 21, Home = 22, Left = 23, Up = 24, Right = 25, Down = 26, PrintScreen = 30, Insert = 31, Delete = 32, Help = 33, D0 = 34, D1 = 35, D2 = 36, D3 = 37, D4 = 38, D5 = 39, D6 = 40, D7 = 41, D8 = 42, D9 = 43, A = 44, B = 45, C = 46, D = 47, E = 48, F = 49, G = 50, H = 51, I = 52, J = 53, K = 54, L = 55, M = 56, N = 57, O = 58, P = 59, Q = 60, R = 61, S = 62, T = 63, U = 64, V = 65, W = 66, X = 67, Y = 68, Z = 69, LWin = 70, RWin = 71, Apps = 72, NumPad0 = 74, NumPad1 = 75, NumPad2 = 76, NumPad3 = 77, NumPad4 = 78, NumPad5 = 79, NumPad6 = 80, NumPad7 = 81, NumPad8 = 82, NumPad9 = 83, Multiply = 84, Add = 85, Subtract = 87, Decimal = 88, Divide = 89, F1 = 90, F2 = 91, F3 = 92, F4 = 93, F5 = 94, F6 = 95, F7 = 96, F8 = 97, F9 = 98, F10 = 99, F11 = 100, F12 = 101, F13 = 102, F14 = 103, F15 = 104, F16 = 105, F17 = 106, F18 = 107, F19 = 108, F20 = 109, F21 = 110, F22 = 111, F23 = 112, F24 = 113, NumLock = 114, ScrollLock = 115, LeftShift = 116, RightShift = 117, LeftCtrl = 118, RightCtrl = 119, LeftAlt = 120, RightAlt = 121, OemSemicolon = 140, OemPlus = 141, OemComma = 142, OemMinus = 143, OemPeriod = 144, OemSlash = 145, OemTilde = 146, OemOpenBrackets = 149, OemPipe = 150, OemCloseBrackets = 151, OemQuotes = 152, GamepadLeft = 175, GamepadUp = 176, GamepadRight = 177, GamepadDown = 178, GamepadAccept = 179, GamepadCancel = 180, GamepadMenu = 181, GamepadView = 182, GamepadPageUp = 183, GamepadPageDown = 184, GamepadPageLeft = 185, GamepadPageRight = 186, GamepadContext1 = 187, GamepadContext2 = 188, GamepadContext3 = 189, GamepadContext4 = 190,
}
Expand description

Common subset of Noesis::Key from NsGui/InputEnums.h. Values are the C++ enum ordinals, validated by static_assert in noesis_view.cpp. View::key_down takes this typed enum, so a key outside the subset can’t be sent until it is added here — add the variant (with a matching assert in C++) to centralize the mapping.

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

None = 0

§

Back = 2

§

Tab = 3

§

Return = 6

§

Pause = 7

§

CapsLock = 8

§

Escape = 13

§

Space = 18

§

PageUp = 19

§

PageDown = 20

§

End = 21

§

Home = 22

§

Left = 23

§

Up = 24

§

Right = 25

§

Down = 26

§

PrintScreen = 30

§

Insert = 31

§

Delete = 32

§

Help = 33

§

D0 = 34

§

D1 = 35

§

D2 = 36

§

D3 = 37

§

D4 = 38

§

D5 = 39

§

D6 = 40

§

D7 = 41

§

D8 = 42

§

D9 = 43

§

A = 44

§

B = 45

§

C = 46

§

D = 47

§

E = 48

§

F = 49

§

G = 50

§

H = 51

§

I = 52

§

J = 53

§

K = 54

§

L = 55

§

M = 56

§

N = 57

§

O = 58

§

P = 59

§

Q = 60

§

R = 61

§

S = 62

§

T = 63

§

U = 64

§

V = 65

§

W = 66

§

X = 67

§

Y = 68

§

Z = 69

§

LWin = 70

§

RWin = 71

§

Apps = 72

§

NumPad0 = 74

§

NumPad1 = 75

§

NumPad2 = 76

§

NumPad3 = 77

§

NumPad4 = 78

§

NumPad5 = 79

§

NumPad6 = 80

§

NumPad7 = 81

§

NumPad8 = 82

§

NumPad9 = 83

§

Multiply = 84

§

Add = 85

§

Subtract = 87

§

Decimal = 88

§

Divide = 89

§

F1 = 90

§

F2 = 91

§

F3 = 92

§

F4 = 93

§

F5 = 94

§

F6 = 95

§

F7 = 96

§

F8 = 97

§

F9 = 98

§

F10 = 99

§

F11 = 100

§

F12 = 101

§

F13 = 102

§

F14 = 103

§

F15 = 104

§

F16 = 105

§

F17 = 106

§

F18 = 107

§

F19 = 108

§

F20 = 109

§

F21 = 110

§

F22 = 111

§

F23 = 112

§

F24 = 113

§

NumLock = 114

§

ScrollLock = 115

§

LeftShift = 116

§

RightShift = 117

§

LeftCtrl = 118

§

RightCtrl = 119

§

LeftAlt = 120

§

RightAlt = 121

§

OemSemicolon = 140

Semicolon / colon on US layouts (Key_Oem1 / Key_OemSemicolon).

§

OemPlus = 141

= / + (Key_OemPlus).

§

OemComma = 142

§

OemMinus = 143

§

OemPeriod = 144

§

OemSlash = 145

/ / ? (Key_Oem2 / Key_OemQuestion).

§

OemTilde = 146

Backtick / tilde (Key_Oem3 / Key_OemTilde).

§

OemOpenBrackets = 149

[ / { (Key_Oem4 / Key_OemOpenBrackets).

§

OemPipe = 150

\ / | (Key_Oem5 / Key_OemPipe).

§

OemCloseBrackets = 151

] / } (Key_Oem6 / Key_OemCloseBrackets).

§

OemQuotes = 152

' / " (Key_Oem7 / Key_OemQuotes).

§

GamepadLeft = 175

Gamepad D-pad / left-stick left. Drives directional focus navigation (moves focus left) when the focused element uses Noesis directional nav.

§

GamepadUp = 176

Gamepad D-pad / left-stick up. Moves directional focus up.

§

GamepadRight = 177

Gamepad D-pad / left-stick right. Moves directional focus right.

§

GamepadDown = 178

Gamepad D-pad / left-stick down. Moves directional focus down.

§

GamepadAccept = 179

Gamepad A / accept button. Activates the focused control (like Return) and engages focus scopes.

§

GamepadCancel = 180

Gamepad B / cancel button. Cancels / disengages the current focus scope (like Escape).

§

GamepadMenu = 181

Gamepad menu / start button.

§

GamepadView = 182

Gamepad view / back button.

§

GamepadPageUp = 183

Gamepad page up (typically a shoulder/bumper), for paged scrolling.

§

GamepadPageDown = 184

Gamepad page down (typically a shoulder/bumper), for paged scrolling.

§

GamepadPageLeft = 185

Gamepad page left (typically a trigger), for horizontal paged scrolling.

§

GamepadPageRight = 186

Gamepad page right (typically a trigger), for horizontal paged scrolling.

§

GamepadContext1 = 187

Gamepad context-action button 1 (Key_GamepadContext1), free for app-defined bindings.

§

GamepadContext2 = 188

Gamepad context-action button 2 (Key_GamepadContext2).

§

GamepadContext3 = 189

Gamepad context-action button 3 (Key_GamepadContext3).

§

GamepadContext4 = 190

Gamepad context-action button 4 (Key_GamepadContext4).

Trait Implementations§

Source§

impl Clone for Key

Source§

fn clone(&self) -> Key

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 Key

Source§

impl Debug for Key

Source§

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

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

impl Eq for Key

Source§

impl PartialEq for Key

Source§

fn eq(&self, other: &Key) -> 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 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 UnsafeUnpin 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, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

Source§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
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> 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>

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

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

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

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

Converts &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)

Converts &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 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> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

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

Source§

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

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<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<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> ErasedDestructor for T
where T: 'static,

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, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> HitDataExtra for T
where T: Send + Sync + Debug + Any + 'static,

Source§

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

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

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

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

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of this value.
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