Enum bevy_input::keyboard::KeyCode
source · #[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.
The NavigateForward / Prior key.
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 Enum for KeyCode
impl Enum for KeyCode
source§fn field(&self, __name_param: &str) -> Option<&dyn Reflect>
fn field(&self, __name_param: &str) -> Option<&dyn Reflect>
source§fn field_at(&self, __index_param: usize) -> Option<&dyn Reflect>
fn field_at(&self, __index_param: usize) -> Option<&dyn Reflect>
source§fn field_mut(&mut self, __name_param: &str) -> Option<&mut dyn Reflect>
fn field_mut(&mut self, __name_param: &str) -> Option<&mut dyn Reflect>
source§fn field_at_mut(&mut self, __index_param: usize) -> Option<&mut dyn Reflect>
fn field_at_mut(&mut self, __index_param: usize) -> Option<&mut dyn Reflect>
source§fn index_of(&self, __name_param: &str) -> Option<usize>
fn index_of(&self, __name_param: &str) -> Option<usize>
source§fn name_at(&self, __index_param: usize) -> Option<&str>
fn name_at(&self, __index_param: usize) -> Option<&str>
source§fn iter_fields(&self) -> VariantFieldIter<'_>
fn iter_fields(&self) -> VariantFieldIter<'_>
source§fn variant_name(&self) -> &str
fn variant_name(&self) -> &str
source§fn variant_index(&self) -> usize
fn variant_index(&self) -> usize
source§fn variant_type(&self) -> VariantType
fn variant_type(&self) -> VariantType
fn clone_dynamic(&self) -> DynamicEnum
source§fn is_variant(&self, variant_type: VariantType) -> bool
fn is_variant(&self, variant_type: VariantType) -> bool
source§fn variant_path(&self) -> String
fn variant_path(&self) -> String
source§impl FromReflect for KeyCode
impl FromReflect for KeyCode
source§fn from_reflect(__param0: &dyn Reflect) -> Option<Self>
fn from_reflect(__param0: &dyn Reflect) -> Option<Self>
Self from a reflected value.source§fn take_from_reflect(
reflect: Box<dyn Reflect>
) -> Result<Self, Box<dyn Reflect>>
fn take_from_reflect( reflect: Box<dyn Reflect> ) -> Result<Self, Box<dyn Reflect>>
Self using,
constructing the value using from_reflect if that fails. Read moresource§impl Ord for KeyCode
impl Ord for KeyCode
source§impl PartialEq for KeyCode
impl PartialEq for KeyCode
source§impl PartialOrd for KeyCode
impl PartialOrd for KeyCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl Reflect for KeyCode
impl Reflect for KeyCode
source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any.source§fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
source§fn as_reflect(&self) -> &dyn Reflect
fn as_reflect(&self) -> &dyn Reflect
source§fn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
source§fn clone_value(&self) -> Box<dyn Reflect>
fn clone_value(&self) -> Box<dyn Reflect>
Reflect trait object. Read moresource§fn set(
&mut self,
__value_param: Box<dyn Reflect>
) -> Result<(), Box<dyn Reflect>>
fn set( &mut self, __value_param: Box<dyn Reflect> ) -> Result<(), Box<dyn Reflect>>
source§fn apply(&mut self, __value_param: &dyn Reflect)
fn apply(&mut self, __value_param: &dyn Reflect)
source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
source§fn reflect_owned(self: Box<Self>) -> ReflectOwned
fn reflect_owned(self: Box<Self>) -> ReflectOwned
source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
source§fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
source§fn type_name(&self) -> &str
fn type_name(&self) -> &str
source§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
source§impl TypePath for KeyCode
impl TypePath for KeyCode
source§fn type_path() -> &'static str
fn type_path() -> &'static str
source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
impl Copy for KeyCode
impl Eq for KeyCode
impl StructuralEq for KeyCode
impl StructuralPartialEq for KeyCode
Auto Trait Implementations§
impl RefUnwindSafe for KeyCode
impl Send for KeyCode
impl Sync for KeyCode
impl Unpin for KeyCode
impl UnwindSafe for KeyCode
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere T: TypePath,
source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path.source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident.source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name.source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.source§impl<T> GetPath for Twhere
T: Reflect + ?Sized,
impl<T> GetPath for Twhere T: Reflect + ?Sized,
source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>
) -> Result<&(dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p> ) -> Result<&(dyn Reflect + 'static), ReflectPathError<'p>>
path. Read moresource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>
) -> Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p> ) -> Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>
path. Read moresource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>( &self, path: impl ReflectPath<'p> ) -> Result<&T, ReflectPathError<'p>>where T: Reflect,
path. Read moresource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>( &mut self, path: impl ReflectPath<'p> ) -> Result<&mut T, ReflectPathError<'p>>where T: Reflect,
path. Read more