#[repr(u32)]pub enum KeyCode {
Show 163 variants
Key1,
Key2,
Key3,
Key4,
Key5,
Key6,
Key7,
Key8,
Key9,
Key0,
A,
B,
C,
D,
E,
F,
G,
H,
I,
J,
K,
L,
M,
N,
O,
P,
Q,
R,
S,
T,
U,
V,
W,
X,
Y,
Z,
Escape,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
F21,
F22,
F23,
F24,
Snapshot,
Scroll,
Pause,
Insert,
Home,
Delete,
End,
PageDown,
PageUp,
Left,
Up,
Right,
Down,
Back,
Return,
Space,
Compose,
Caret,
Numlock,
Numpad0,
Numpad1,
Numpad2,
Numpad3,
Numpad4,
Numpad5,
Numpad6,
Numpad7,
Numpad8,
Numpad9,
AbntC1,
AbntC2,
NumpadAdd,
Apostrophe,
Apps,
Asterisk,
Plus,
At,
Ax,
Backslash,
Calculator,
Capital,
Colon,
Comma,
Convert,
NumpadDecimal,
NumpadDivide,
Equals,
Grave,
Kana,
Kanji,
AltLeft,
BracketLeft,
ControlLeft,
ShiftLeft,
SuperLeft,
Mail,
MediaSelect,
MediaStop,
Minus,
NumpadMultiply,
Mute,
MyComputer,
NavigateForward,
NavigateBackward,
NextTrack,
NoConvert,
NumpadComma,
NumpadEnter,
NumpadEquals,
Oem102,
Period,
PlayPause,
Power,
PrevTrack,
AltRight,
BracketRight,
ControlRight,
ShiftRight,
SuperRight,
Semicolon,
Slash,
Sleep,
Stop,
NumpadSubtract,
Sysrq,
Tab,
Underline,
Unlabeled,
VolumeDown,
VolumeUp,
Wake,
WebBack,
WebFavorites,
WebForward,
WebHome,
WebRefresh,
WebSearch,
WebStop,
Yen,
Copy,
Paste,
Cut,
}
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
The 1
key over the letters.
Key2
The 2
key over the letters.
Key3
The 3
key over the letters.
Key4
The 4
key over the letters.
Key5
The 5
key over the letters.
Key6
The 6
key over the letters.
Key7
The 7
key over the letters.
Key8
The 8
key over the letters.
Key9
The 9
key over the letters.
Key0
The 0
key over the letters.
A
The A
key.
B
The B
key.
C
The C
key.
D
The D
key.
E
The E
key.
F
The F
key.
G
The G
key.
H
The H
key.
I
The I
key.
J
The J
key.
K
The K
key.
L
The L
key.
M
The M
key.
N
The N
key.
O
The O
key.
P
The P
key.
Q
The Q
key.
R
The R
key.
S
The S
key.
T
The T
key.
U
The U
key.
V
The V
key.
W
The W
key.
X
The X
key.
Y
The Y
key.
Z
The Z
key.
Escape
The Escape
/ ESC
key, next to the F1
key.
F1
The F1
key.
F2
The F2
key.
F3
The F3
key.
F4
The F4
key.
F5
The F5
key.
F6
The F6
key.
F7
The F7
key.
F8
The F8
key.
F9
The F9
key.
F10
The F10
key.
F11
The F11
key.
F12
The F12
key.
F13
The F13
key.
F14
The F14
key.
F15
The F15
key.
F16
The F16
key.
F17
The F17
key.
F18
The F18
key.
F19
The F19
key.
F20
The F20
key.
F21
The F21
key.
F22
The F22
key.
F23
The F23
key.
F24
The F24
key.
Snapshot
The Snapshot
/ Print Screen
key.
Scroll
The Scroll
/ Scroll Lock
key.
Pause
The Pause
/ Break
key, next to the Scroll
key.
Insert
The Insert
key, next to the Backspace
key.
Home
The Home
key.
Delete
The Delete
key.
End
The End
key.
PageDown
The PageDown
key.
PageUp
The PageUp
key.
Left
The Left
/ Left Arrow
key.
Up
The Up
/ Up Arrow
key.
Right
The Right
/ Right Arrow
key.
Down
The Down
/ Down Arrow
key.
Back
The Back
/ Backspace
key.
Return
The Return
/ Enter
key.
Space
The Space
/ Spacebar
/
key.
Compose
The Compose
key on Linux.
Caret
The Caret
/ ^
key.
Numlock
The Numlock
key.
Numpad0
The Numpad0
/ 0
key.
Numpad1
The Numpad1
/ 1
key.
Numpad2
The Numpad2
/ 2
key.
Numpad3
The Numpad3
/ 3
key.
Numpad4
The Numpad4
/ 4
key.
Numpad5
The Numpad5
/ 5
key.
Numpad6
The Numpad6
/ 6
key.
Numpad7
The Numpad7
/ 7
key.
Numpad8
The Numpad8
/ 8
key.
Numpad9
The Numpad9
/ 9
key.
AbntC1
The AbntC1
key.
AbntC2
The AbntC2
key.
NumpadAdd
The NumpadAdd
/ +
key.
Apostrophe
The Apostrophe
/ '
key.
Apps
The Apps
key.
Asterisk
The Asterisk
/ *
key.
Plus
The Plus
/ +
key.
At
The At
/ @
key.
Ax
The Ax
key.
Backslash
The Backslash
/ \
key.
Calculator
The Calculator
key.
Capital
The Capital
key.
Colon
The Colon
/ :
key.
Comma
The Comma
/ ,
key.
Convert
The Convert
key.
NumpadDecimal
The NumpadDecimal
/ .
key.
NumpadDivide
The NumpadDivide
/ /
key.
Equals
The Equals
/ =
key.
Grave
The Grave
/ Backtick
/ `
key.
Kana
The Kana
key.
Kanji
The Kanji
key.
AltLeft
The Left Alt
key. Maps to Left Option
on Mac.
BracketLeft
The Left Bracket
/ [
key.
ControlLeft
The Left Control
key.
ShiftLeft
The Left Shift
key.
SuperLeft
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.
The Mail
key.
MediaSelect
The MediaSelect
key.
MediaStop
The MediaStop
key.
Minus
The Minus
/ -
key.
NumpadMultiply
The NumpadMultiply
/ *
key.
Mute
The Mute
key.
MyComputer
The MyComputer
key.
The NavigateForward
/ Prior
key.
The NavigateBackward
/ Next
key.
NextTrack
The NextTrack
key.
NoConvert
The NoConvert
key.
NumpadComma
The NumpadComma
/ ,
key.
NumpadEnter
The NumpadEnter
key.
NumpadEquals
The NumpadEquals
/ =
key.
Oem102
The Oem102
key.
Period
The Period
/ .
key.
PlayPause
The PlayPause
key.
Power
The Power
key.
PrevTrack
The PrevTrack
key.
AltRight
The Right Alt
key. Maps to Right Option
on Mac.
BracketRight
The Right Bracket
/ ]
key.
ControlRight
The Right Control
key.
ShiftRight
The Right Shift
key.
SuperRight
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
The Semicolon
/ ;
key.
Slash
The Slash
/ /
key.
Sleep
The Sleep
key.
Stop
The Stop
key.
NumpadSubtract
The NumpadSubtract
/ -
key.
Sysrq
The Sysrq
key.
Tab
The Tab
/
key.
Underline
The Underline
/ _
key.
Unlabeled
The Unlabeled
key.
VolumeDown
The VolumeDown
key.
VolumeUp
The VolumeUp
key.
Wake
The Wake
key.
WebBack
The WebBack
key.
WebFavorites
The WebFavorites
key.
WebForward
The WebForward
key.
WebHome
The WebHome
key.
WebRefresh
The WebRefresh
key.
WebSearch
The WebSearch
key.
WebStop
The WebStop
key.
Yen
The Yen
key.
Copy
The Copy
key.
Paste
The Paste
key.
Cut
The Cut
key.
Trait Implementations§
§impl<'de> Deserialize<'de> for KeyCode
impl<'de> Deserialize<'de> for KeyCode
§fn deserialize<__D>(
__deserializer: __D
) -> Result<KeyCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<KeyCode, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
§impl Enum for KeyCode
impl Enum for KeyCode
§fn field(&self, __name_param: &str) -> Option<&(dyn Reflect + 'static)>
fn field(&self, __name_param: &str) -> Option<&(dyn Reflect + 'static)>
§fn field_at(&self, __index_param: usize) -> Option<&(dyn Reflect + 'static)>
fn field_at(&self, __index_param: usize) -> Option<&(dyn Reflect + 'static)>
§fn field_mut(
&mut self,
__name_param: &str
) -> Option<&mut (dyn Reflect + 'static)>
fn field_mut( &mut self, __name_param: &str ) -> Option<&mut (dyn Reflect + 'static)>
§fn field_at_mut(
&mut self,
__index_param: usize
) -> Option<&mut (dyn Reflect + 'static)>
fn field_at_mut( &mut self, __index_param: usize ) -> Option<&mut (dyn Reflect + 'static)>
§fn index_of(&self, __name_param: &str) -> Option<usize>
fn index_of(&self, __name_param: &str) -> Option<usize>
§fn name_at(&self, __index_param: usize) -> Option<&str>
fn name_at(&self, __index_param: usize) -> Option<&str>
§fn iter_fields(&self) -> VariantFieldIter<'_> ⓘ
fn iter_fields(&self) -> VariantFieldIter<'_> ⓘ
§fn variant_name(&self) -> &str
fn variant_name(&self) -> &str
§fn variant_index(&self) -> usize
fn variant_index(&self) -> usize
§fn variant_type(&self) -> VariantType
fn variant_type(&self) -> VariantType
fn clone_dynamic(&self) -> DynamicEnum
§fn is_variant(&self, variant_type: VariantType) -> bool
fn is_variant(&self, variant_type: VariantType) -> bool
§fn variant_path(&self) -> String
fn variant_path(&self) -> String
§impl FromReflect for KeyCode
impl FromReflect for KeyCode
§fn from_reflect(__param0: &(dyn Reflect + 'static)) -> Option<KeyCode>
fn from_reflect(__param0: &(dyn Reflect + 'static)) -> Option<KeyCode>
Self
from a reflected value.§impl GetTypeRegistration for KeyCode
impl GetTypeRegistration for KeyCode
§impl Ord for KeyCode
impl Ord for KeyCode
§impl PartialOrd<KeyCode> for KeyCode
impl PartialOrd<KeyCode> for KeyCode
§fn partial_cmp(&self, other: &KeyCode) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyCode) -> Option<Ordering>
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 more§impl Reflect for KeyCode
impl Reflect for KeyCode
§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
§fn into_any(self: Box<KeyCode, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<KeyCode, Global>) -> Box<dyn Any, Global>
Box<dyn Any>
.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut dyn Any
.§fn into_reflect(self: Box<KeyCode, Global>) -> Box<dyn Reflect, Global>
fn into_reflect(self: Box<KeyCode, Global>) -> Box<dyn Reflect, Global>
§fn as_reflect(&self) -> &(dyn Reflect + 'static)
fn as_reflect(&self) -> &(dyn Reflect + 'static)
§fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
§fn clone_value(&self) -> Box<dyn Reflect, Global>
fn clone_value(&self) -> Box<dyn Reflect, Global>
Reflect
trait object. Read more§fn set(
&mut self,
__value_param: Box<dyn Reflect, Global>
) -> Result<(), Box<dyn Reflect, Global>>
fn set( &mut self, __value_param: Box<dyn Reflect, Global> ) -> Result<(), Box<dyn Reflect, Global>>
§fn apply(&mut self, __value_param: &(dyn Reflect + 'static))
fn apply(&mut self, __value_param: &(dyn Reflect + 'static))
§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
§fn reflect_owned(self: Box<KeyCode, Global>) -> ReflectOwned
fn reflect_owned(self: Box<KeyCode, Global>) -> ReflectOwned
§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
§fn reflect_partial_eq(&self, value: &(dyn Reflect + 'static)) -> Option<bool>
fn reflect_partial_eq(&self, value: &(dyn Reflect + 'static)) -> Option<bool>
§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
§impl Serialize for KeyCode
impl Serialize for KeyCode
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
§impl TypePath for KeyCode
impl TypePath for KeyCode
§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
§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§
§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere U: ShaderType, &'a T: for<'a> Into<U>,
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
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, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
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.§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere T: TypePath,
§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path
.§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident
.§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name
.§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<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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> GetPath for Twhere
T: Reflect + ?Sized,
impl<T> GetPath for Twhere T: Reflect + ?Sized,
§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 more§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 more§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 more§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