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,
LAlt,
LBracket,
LControl,
LShift,
LWin,
Mail,
MediaSelect,
MediaStop,
Minus,
NumpadMultiply,
Mute,
MyComputer,
NavigateForward,
NavigateBackward,
NextTrack,
NoConvert,
NumpadComma,
NumpadEnter,
NumpadEquals,
Oem102,
Period,
PlayPause,
Power,
PrevTrack,
RAlt,
RBracket,
RControl,
RShift,
RWin,
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 Asterik
/ *
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.
LAlt
The LAlt
/ Left Alt
key. Maps to Left Option
on Mac.
LBracket
The LBracket
/ Left Bracket
key.
LControl
The LControl
/ Left Control
key.
LShift
The LShift
/ Left Shift
key.
LWin
The LWin
/ Left Windows
key. Maps to Left Command
on Mac.
Mail
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.
NavigateForward
The NavigateForward
/ Prior
key.
NavigateBackward
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.
RAlt
The RAlt
/ Right Alt
key. Maps to Right Option
on Mac.
RBracket
The RBracket
/ Right Bracket
key.
RControl
The RControl
/ Right Control
key.
RShift
The RShift
/ Right Shift
key.
RWin
The RWin
/ Right Windows
key. Maps to Right Command
on Mac.
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 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
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
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 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Reflect for KeyCode
impl Reflect for KeyCode
fn get_type_info(&self) -> &'static TypeInfo
fn get_type_info(&self) -> &'static TypeInfo
fn into_any(self: Box<KeyCode, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<KeyCode, Global>) -> Box<dyn Any + 'static, 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 + 'static, Global>
fn into_reflect(
self: Box<KeyCode, Global>
) -> Box<dyn Reflect + 'static, 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 + 'static, Global>
fn clone_value(&self) -> Box<dyn Reflect + 'static, Global>
Reflect
trait object. Read morefn set(
&mut self,
__value_param: Box<dyn Reflect + 'static, Global>
) -> Result<(), Box<dyn Reflect + 'static, Global>>
fn set(
&mut self,
__value_param: Box<dyn Reflect + 'static, Global>
) -> Result<(), Box<dyn Reflect + 'static, 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 serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
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. Read moresourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn 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 + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, 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
. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read morefn 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. Read morefn 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. Read moresourceimpl<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,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.impl<T> GetPath for Twhere
T: Reflect,
impl<T> GetPath for Twhere
T: Reflect,
fn path<'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
fn path<'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read morefn path_mut<'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
fn path_mut<'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read morefn get_path<T, 'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r T, ReflectPathError<'p>>where
T: Reflect,
fn get_path<T, 'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r T, ReflectPathError<'p>>where
T: Reflect,
path
.fn get_path_mut<T, 'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut T, ReflectPathError<'p>>where
T: Reflect,
fn get_path_mut<T, 'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut T, ReflectPathError<'p>>where
T: Reflect,
path
. Read more