Enum bevy::input::keyboard::KeyCode

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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns a reference to the value of the field (in the current variant) with the given name. Read more
Returns a reference to the value of the field (in the current variant) at the given index.
Returns a mutable reference to the value of the field (in the current variant) with the given name. Read more
Returns a mutable reference to the value of the field (in the current variant) at the given index.
Returns the index of the field (in the current variant) with the given name. Read more
Returns the name of the field (in the current variant) with the given index. Read more
Returns an iterator over the values of the current variant’s fields.
Returns the number of fields in the current variant.
The name of the current variant.
The index of the current variant.
The type of the current variant.
Returns true if the current variant’s type matches the given one.
Returns the full path to the current variant.
Constructs a concrete instance of Self from a reflected value.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Returns the type name of the underlying type.
Returns the TypeInfo of the underlying type. Read more
Returns the value as a Box<dyn Any>.
Returns the value as a &dyn Any.
Returns the value as a &mut dyn Any.
Casts this type to a boxed reflected value.
Casts this type to a reflected value.
Casts this type to a mutable reflected value.
Clones the value as a Reflect trait object. Read more
Performs a type-checked assignment of a reflected value to this value. Read more
Applies a reflected value to this value. Read more
Returns an enumeration of “kinds” of type. Read more
Returns a mutable enumeration of “kinds” of type. Read more
Returns an owned enumeration of “kinds” of type. Read more
Returns a hash of the value (which includes the type). Read more
Returns a “partial equality” comparison result. Read more
Debug formatter for the value. Read more
Returns a serializable version of the value. Read more
Returns the compile-time info for the underlying type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
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. Read more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Returns a reference to the value specified by path. Read more
Returns a mutable reference to the value specified by path. Read more
Returns a statically typed reference to the value specified by path.
Returns a statically typed mutable reference to the value specified by path. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more