#[repr(u32)]
pub enum KeyCode {
Show 163 variants Key1 = 0, Key2 = 1, Key3 = 2, Key4 = 3, Key5 = 4, Key6 = 5, Key7 = 6, Key8 = 7, Key9 = 8, Key0 = 9, A = 10, B = 11, C = 12, D = 13, E = 14, F = 15, G = 16, H = 17, I = 18, J = 19, K = 20, L = 21, M = 22, N = 23, O = 24, P = 25, Q = 26, R = 27, S = 28, T = 29, U = 30, V = 31, W = 32, X = 33, Y = 34, Z = 35, Escape = 36, F1 = 37, F2 = 38, F3 = 39, F4 = 40, F5 = 41, F6 = 42, F7 = 43, F8 = 44, F9 = 45, F10 = 46, F11 = 47, F12 = 48, F13 = 49, F14 = 50, F15 = 51, F16 = 52, F17 = 53, F18 = 54, F19 = 55, F20 = 56, F21 = 57, F22 = 58, F23 = 59, F24 = 60, Snapshot = 61, Scroll = 62, Pause = 63, Insert = 64, Home = 65, Delete = 66, End = 67, PageDown = 68, PageUp = 69, Left = 70, Up = 71, Right = 72, Down = 73, Back = 74, Return = 75, Space = 76, Compose = 77, Caret = 78, Numlock = 79, Numpad0 = 80, Numpad1 = 81, Numpad2 = 82, Numpad3 = 83, Numpad4 = 84, Numpad5 = 85, Numpad6 = 86, Numpad7 = 87, Numpad8 = 88, Numpad9 = 89, AbntC1 = 90, AbntC2 = 91, NumpadAdd = 92, Apostrophe = 93, Apps = 94, Asterisk = 95, Plus = 96, At = 97, Ax = 98, Backslash = 99, Calculator = 100, Capital = 101, Colon = 102, Comma = 103, Convert = 104, NumpadDecimal = 105, NumpadDivide = 106, Equals = 107, Grave = 108, Kana = 109, Kanji = 110, AltLeft = 111, BracketLeft = 112, ControlLeft = 113, ShiftLeft = 114, SuperLeft = 115, Mail = 116, MediaSelect = 117, MediaStop = 118, Minus = 119, NumpadMultiply = 120, Mute = 121, MyComputer = 122, NavigateForward = 123, NavigateBackward = 124, NextTrack = 125, NoConvert = 126, NumpadComma = 127, NumpadEnter = 128, NumpadEquals = 129, Oem102 = 130, Period = 131, PlayPause = 132, Power = 133, PrevTrack = 134, AltRight = 135, BracketRight = 136, ControlRight = 137, ShiftRight = 138, SuperRight = 139, Semicolon = 140, Slash = 141, Sleep = 142, Stop = 143, NumpadSubtract = 144, Sysrq = 145, Tab = 146, Underline = 147, Unlabeled = 148, VolumeDown = 149, VolumeUp = 150, Wake = 151, WebBack = 152, WebFavorites = 153, WebForward = 154, WebHome = 155, WebRefresh = 156, WebSearch = 157, WebStop = 158, Yen = 159, Copy = 160, Paste = 161, Cut = 162,
}
Expand description

The key code of a KeyboardInput.

Usage

It is used as the generic T value of an Input to create a Res<Input<KeyCode>>. The resource values are mapped to the current layout of the keyboard and correlate to an ScanCode.

Updating

The resource is updated inside of the keyboard_input_system.

Variants§

§

Key1 = 0

The 1 key over the letters.

§

Key2 = 1

The 2 key over the letters.

§

Key3 = 2

The 3 key over the letters.

§

Key4 = 3

The 4 key over the letters.

§

Key5 = 4

The 5 key over the letters.

§

Key6 = 5

The 6 key over the letters.

§

Key7 = 6

The 7 key over the letters.

§

Key8 = 7

The 8 key over the letters.

§

Key9 = 8

The 9 key over the letters.

§

Key0 = 9

The 0 key over the letters.

§

A = 10

The A key.

§

B = 11

The B key.

§

C = 12

The C key.

§

D = 13

The D key.

§

E = 14

The E key.

§

F = 15

The F key.

§

G = 16

The G key.

§

H = 17

The H key.

§

I = 18

The I key.

§

J = 19

The J key.

§

K = 20

The K key.

§

L = 21

The L key.

§

M = 22

The M key.

§

N = 23

The N key.

§

O = 24

The O key.

§

P = 25

The P key.

§

Q = 26

The Q key.

§

R = 27

The R key.

§

S = 28

The S key.

§

T = 29

The T key.

§

U = 30

The U key.

§

V = 31

The V key.

§

W = 32

The W key.

§

X = 33

The X key.

§

Y = 34

The Y key.

§

Z = 35

The Z key.

§

Escape = 36

The Escape / ESC key, next to the F1 key.

§

F1 = 37

The F1 key.

§

F2 = 38

The F2 key.

§

F3 = 39

The F3 key.

§

F4 = 40

The F4 key.

§

F5 = 41

The F5 key.

§

F6 = 42

The F6 key.

§

F7 = 43

The F7 key.

§

F8 = 44

The F8 key.

§

F9 = 45

The F9 key.

§

F10 = 46

The F10 key.

§

F11 = 47

The F11 key.

§

F12 = 48

The F12 key.

§

F13 = 49

The F13 key.

§

F14 = 50

The F14 key.

§

F15 = 51

The F15 key.

§

F16 = 52

The F16 key.

§

F17 = 53

The F17 key.

§

F18 = 54

The F18 key.

§

F19 = 55

The F19 key.

§

F20 = 56

The F20 key.

§

F21 = 57

The F21 key.

§

F22 = 58

The F22 key.

§

F23 = 59

The F23 key.

§

F24 = 60

The F24 key.

§

Snapshot = 61

The Snapshot / Print Screen key.

§

Scroll = 62

The Scroll / Scroll Lock key.

§

Pause = 63

The Pause / Break key, next to the Scroll key.

§

Insert = 64

The Insert key, next to the Backspace key.

§

Home = 65

The Home key.

§

Delete = 66

The Delete key.

§

End = 67

The End key.

§

PageDown = 68

The PageDown key.

§

PageUp = 69

The PageUp key.

§

Left = 70

The Left / Left Arrow key.

§

Up = 71

The Up / Up Arrow key.

§

Right = 72

The Right / Right Arrow key.

§

Down = 73

The Down / Down Arrow key.

§

Back = 74

The Back / Backspace key.

§

Return = 75

The Return / Enter key.

§

Space = 76

The Space / Spacebar / key.

§

Compose = 77

The Compose key on Linux.

§

Caret = 78

The Caret / ^ key.

§

Numlock = 79

The Numlock key.

§

Numpad0 = 80

The Numpad0 / 0 key.

§

Numpad1 = 81

The Numpad1 / 1 key.

§

Numpad2 = 82

The Numpad2 / 2 key.

§

Numpad3 = 83

The Numpad3 / 3 key.

§

Numpad4 = 84

The Numpad4 / 4 key.

§

Numpad5 = 85

The Numpad5 / 5 key.

§

Numpad6 = 86

The Numpad6 / 6 key.

§

Numpad7 = 87

The Numpad7 / 7 key.

§

Numpad8 = 88

The Numpad8 / 8 key.

§

Numpad9 = 89

The Numpad9 / 9 key.

§

AbntC1 = 90

The AbntC1 key.

§

AbntC2 = 91

The AbntC2 key.

§

NumpadAdd = 92

The NumpadAdd / + key.

§

Apostrophe = 93

The Apostrophe / ' key.

§

Apps = 94

The Apps key.

§

Asterisk = 95

The Asterisk / * key.

§

Plus = 96

The Plus / + key.

§

At = 97

The At / @ key.

§

Ax = 98

The Ax key.

§

Backslash = 99

The Backslash / \ key.

§

Calculator = 100

The Calculator key.

§

Capital = 101

The Capital key.

§

Colon = 102

The Colon / : key.

§

Comma = 103

The Comma / , key.

§

Convert = 104

The Convert key.

§

NumpadDecimal = 105

The NumpadDecimal / . key.

§

NumpadDivide = 106

The NumpadDivide / / key.

§

Equals = 107

The Equals / = key.

§

Grave = 108

The Grave / Backtick / ` key.

§

Kana = 109

The Kana key.

§

Kanji = 110

The Kanji key.

§

AltLeft = 111

The Left Alt key. Maps to Left Option on Mac.

§

BracketLeft = 112

The Left Bracket / [ key.

§

ControlLeft = 113

The Left Control key.

§

ShiftLeft = 114

The Left Shift key.

§

SuperLeft = 115

The Left Super key. Generic keyboards usually display this key with the Microsoft Windows logo. Apple keyboards call this key the Command Key and display it using the ⌘ character.

§

Mail = 116

The Mail key.

§

MediaSelect = 117

The MediaSelect key.

§

MediaStop = 118

The MediaStop key.

§

Minus = 119

The Minus / - key.

§

NumpadMultiply = 120

The NumpadMultiply / * key.

§

Mute = 121

The Mute key.

§

MyComputer = 122

The MyComputer key.

§

NavigateForward = 123

The NavigateForward / Prior key.

§

NavigateBackward = 124

The NavigateBackward / Next key.

§

NextTrack = 125

The NextTrack key.

§

NoConvert = 126

The NoConvert key.

§

NumpadComma = 127

The NumpadComma / , key.

§

NumpadEnter = 128

The NumpadEnter key.

§

NumpadEquals = 129

The NumpadEquals / = key.

§

Oem102 = 130

The Oem102 key.

§

Period = 131

The Period / . key.

§

PlayPause = 132

The PlayPause key.

§

Power = 133

The Power key.

§

PrevTrack = 134

The PrevTrack key.

§

AltRight = 135

The Right Alt key. Maps to Right Option on Mac.

§

BracketRight = 136

The Right Bracket / ] key.

§

ControlRight = 137

The Right Control key.

§

ShiftRight = 138

The Right Shift key.

§

SuperRight = 139

The Right Super key. Generic keyboards usually display this key with the Microsoft Windows logo. Apple keyboards call this key the Command Key and display it using the ⌘ character.

§

Semicolon = 140

The Semicolon / ; key.

§

Slash = 141

The Slash / / key.

§

Sleep = 142

The Sleep key.

§

Stop = 143

The Stop key.

§

NumpadSubtract = 144

The NumpadSubtract / - key.

§

Sysrq = 145

The Sysrq key.

§

Tab = 146

The Tab / key.

§

Underline = 147

The Underline / _ key.

§

Unlabeled = 148

The Unlabeled key.

§

VolumeDown = 149

The VolumeDown key.

§

VolumeUp = 150

The VolumeUp key.

§

Wake = 151

The Wake key.

§

WebBack = 152

The WebBack key.

§

WebFavorites = 153

The WebFavorites key.

§

WebForward = 154

The WebForward key.

§

WebHome = 155

The WebHome key.

§

WebRefresh = 156

The WebRefresh key.

§

WebSearch = 157

The WebSearch key.

§

WebStop = 158

The WebStop key.

§

Yen = 159

The Yen key.

§

Copy = 160

The Copy key.

§

Paste = 161

The Paste key.

§

Cut = 162

The Cut key.

Trait Implementations§

source§

impl Clone for KeyCode

source§

fn clone(&self) -> KeyCode

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 KeyCode

source§

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

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

impl Enum for KeyCode

source§

fn field(&self, __name_param: &str) -> Option<&dyn Reflect>

Returns a reference to the value of the field (in the current variant) with the given name. Read more
source§

fn field_at(&self, __index_param: usize) -> Option<&dyn Reflect>

Returns a reference to the value of the field (in the current variant) at the given index.
source§

fn field_mut(&mut self, __name_param: &str) -> Option<&mut dyn Reflect>

Returns a mutable reference to the value of the field (in the current variant) with the given name. Read more
source§

fn field_at_mut(&mut self, __index_param: usize) -> Option<&mut dyn Reflect>

Returns a mutable reference to the value of the field (in the current variant) at the given index.
source§

fn index_of(&self, __name_param: &str) -> Option<usize>

Returns the index of the field (in the current variant) with the given name. Read more
source§

fn name_at(&self, __index_param: usize) -> Option<&str>

Returns the name of the field (in the current variant) with the given index. Read more
source§

fn iter_fields(&self) -> VariantFieldIter<'_>

Returns an iterator over the values of the current variant’s fields.
source§

fn field_len(&self) -> usize

Returns the number of fields in the current variant.
source§

fn variant_name(&self) -> &str

The name of the current variant.
source§

fn variant_index(&self) -> usize

The index of the current variant.
source§

fn variant_type(&self) -> VariantType

The type of the current variant.
source§

fn clone_dynamic(&self) -> DynamicEnum

source§

fn is_variant(&self, variant_type: VariantType) -> bool

Returns true if the current variant’s type matches the given one.
source§

fn variant_path(&self) -> String

Returns the full path to the current variant.
source§

impl FromReflect for KeyCode

source§

fn from_reflect(__param0: &dyn Reflect) -> Option<Self>

Constructs a concrete instance of Self from a reflected value.
source§

fn take_from_reflect( reflect: Box<dyn Reflect> ) -> Result<Self, Box<dyn Reflect>>

Attempts to downcast the given value to Self using, constructing the value using from_reflect if that fails. Read more
source§

impl GetTypeRegistration for KeyCode

source§

impl Hash for KeyCode

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 KeyCode

source§

fn cmp(&self, other: &KeyCode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

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

Compares and returns the maximum of two values. Read more
1.21.0 · source§

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

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

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

impl PartialEq for KeyCode

source§

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

source§

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

source§

fn get_represented_type_info(&self) -> Option<&'static TypeInfo>

Returns the TypeInfo of the type represented by this value. Read more
source§

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

Returns the value as a Box<dyn Any>.
source§

fn as_any(&self) -> &dyn Any

Returns the value as a &dyn Any.
source§

fn as_any_mut(&mut self) -> &mut dyn Any

Returns the value as a &mut dyn Any.
source§

fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>

Casts this type to a boxed reflected value.
source§

fn as_reflect(&self) -> &dyn Reflect

Casts this type to a reflected value.
source§

fn as_reflect_mut(&mut self) -> &mut dyn Reflect

Casts this type to a mutable reflected value.
source§

fn clone_value(&self) -> Box<dyn Reflect>

Clones the value as a Reflect trait object. Read more
source§

fn set( &mut self, __value_param: Box<dyn Reflect> ) -> Result<(), Box<dyn Reflect>>

Performs a type-checked assignment of a reflected value to this value. Read more
source§

fn apply(&mut self, __value_param: &dyn Reflect)

Applies a reflected value to this value. Read more
source§

fn reflect_ref(&self) -> ReflectRef<'_>

Returns an enumeration of “kinds” of type. Read more
source§

fn reflect_mut(&mut self) -> ReflectMut<'_>

Returns a mutable enumeration of “kinds” of type. Read more
source§

fn reflect_owned(self: Box<Self>) -> ReflectOwned

Returns an owned enumeration of “kinds” of type. Read more
source§

fn reflect_hash(&self) -> Option<u64>

Returns a hash of the value (which includes the type). Read more
source§

fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>

Returns a “partial equality” comparison result. Read more
source§

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

Debug formatter for the value. Read more
source§

fn type_name(&self) -> &str

👎Deprecated since 0.12.0: view the method documentation to find alternatives to this method.
Returns the type path of the underlying type. Read more
source§

fn serializable(&self) -> Option<Serializable<'_>>

Returns a serializable version of the value. Read more
source§

fn is_dynamic(&self) -> bool

Indicates whether or not this type is a dynamic type. Read more
source§

impl TypePath for KeyCode

source§

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
source§

fn short_type_path() -> &'static str

Returns a short, pretty-print enabled path to the type. Read more
source§

fn type_ident() -> Option<&'static str>

Returns the name of the type, or None if it is anonymous. Read more
source§

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
source§

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more
source§

impl Typed for KeyCode

source§

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.
source§

impl Copy for KeyCode

source§

impl Eq for KeyCode

source§

impl StructuralEq for KeyCode

source§

impl StructuralPartialEq for KeyCode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Qwhere Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T> Downcast for Twhere T: Any,

§

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

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

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

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

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

§

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<T> DynEq for Twhere T: Any + Eq,

source§

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

Casts the type to dyn Any.
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 Twhere T: DynEq + Hash,

source§

fn as_dyn_eq(&self) -> &(dyn DynEq + 'static)

Casts the type to dyn Any.
source§

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

Feeds this value into the given Hasher.
source§

impl<T> DynamicTypePath for Twhere T: TypePath,

§

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

§

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

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

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

§

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

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> GetPath for Twhere T: Reflect + ?Sized,

source§

fn reflect_path<'p>( &self, path: impl ReflectPath<'p> ) -> Result<&(dyn Reflect + 'static), ReflectPathError<'p>>

Returns a reference to the value specified by path. Read more
source§

fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p> ) -> Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>

Returns a mutable reference to the value specified by path. Read more
source§

fn path<'p, T>( &self, path: impl ReflectPath<'p> ) -> Result<&T, ReflectPathError<'p>>where T: Reflect,

Returns a statically typed reference to the value specified by path. Read more
source§

fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p> ) -> Result<&mut T, ReflectPathError<'p>>where T: Reflect,

Returns a statically typed mutable reference to the value specified by path. Read more
§

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 Twhere 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> ToOwned for Twhere 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 Twhere 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 Twhere 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.
source§

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

§

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

impl<N> NodeTrait for Nwhere N: Copy + Ord + Hash,