#[repr(u8)]pub enum Key {
Show 98 variants
A = 0,
B = 1,
C = 2,
D = 3,
E = 4,
F = 5,
G = 6,
H = 7,
I = 8,
J = 9,
K = 10,
L = 11,
M = 12,
N = 13,
O = 14,
P = 15,
Q = 16,
R = 17,
S = 18,
T = 19,
U = 20,
V = 21,
W = 22,
X = 23,
Y = 24,
Z = 25,
Digit0 = 26,
Digit1 = 27,
Digit2 = 28,
Digit3 = 29,
Digit4 = 30,
Digit5 = 31,
Digit6 = 32,
Digit7 = 33,
Digit8 = 34,
Digit9 = 35,
Left = 36,
Right = 37,
Up = 38,
Down = 39,
Space = 40,
Enter = 41,
Escape = 42,
Tab = 43,
Backspace = 44,
LeftShift = 45,
RightShift = 46,
LeftControl = 47,
RightControl = 48,
LeftAlt = 49,
RightAlt = 50,
F1 = 51,
F2 = 52,
F3 = 53,
F4 = 54,
F5 = 55,
F6 = 56,
F7 = 57,
F8 = 58,
F9 = 59,
F10 = 60,
F11 = 61,
F12 = 62,
Minus = 63,
Equal = 64,
BracketLeft = 65,
BracketRight = 66,
Semicolon = 67,
Quote = 68,
Backquote = 69,
Backslash = 70,
Comma = 71,
Period = 72,
Slash = 73,
Home = 74,
End = 75,
PageUp = 76,
PageDown = 77,
Insert = 78,
Delete = 79,
CapsLock = 80,
Numpad0 = 81,
Numpad1 = 82,
Numpad2 = 83,
Numpad3 = 84,
Numpad4 = 85,
Numpad5 = 86,
Numpad6 = 87,
Numpad7 = 88,
Numpad8 = 89,
Numpad9 = 90,
NumpadAdd = 91,
NumpadSubtract = 92,
NumpadMultiply = 93,
NumpadDivide = 94,
NumpadDecimal = 95,
NumpadEnter = 96,
NumLock = 97,
}Expand description
A key by physical position, independent of the layout in use:
Key::W is the key at the W position on a US keyboard.
Text entry belongs to the UI layer, not here. A key is also a button vocabulary of its own, which is what a prototype binds through before it declares its actions.
Variants§
A = 0
The A key position.
B = 1
The B key position.
C = 2
The C key position.
D = 3
The D key position.
E = 4
The E key position.
F = 5
The F key position.
G = 6
The G key position.
H = 7
The H key position.
I = 8
The I key position.
J = 9
The J key position.
K = 10
The K key position.
L = 11
The L key position.
M = 12
The M key position.
N = 13
The N key position.
O = 14
The O key position.
P = 15
The P key position.
Q = 16
The Q key position.
R = 17
The R key position.
S = 18
The S key position.
T = 19
The T key position.
U = 20
The U key position.
V = 21
The V key position.
W = 22
The W key position.
X = 23
The X key position.
Y = 24
The Y key position.
Z = 25
The Z key position.
Digit0 = 26
The Digit0 key position.
Digit1 = 27
The Digit1 key position.
Digit2 = 28
The Digit2 key position.
Digit3 = 29
The Digit3 key position.
Digit4 = 30
The Digit4 key position.
Digit5 = 31
The Digit5 key position.
Digit6 = 32
The Digit6 key position.
Digit7 = 33
The Digit7 key position.
Digit8 = 34
The Digit8 key position.
Digit9 = 35
The Digit9 key position.
Left = 36
The Left key position.
Right = 37
The Right key position.
Up = 38
The Up key position.
Down = 39
The Down key position.
Space = 40
The Space key position.
Enter = 41
The Enter key position.
Escape = 42
The Escape key position.
Tab = 43
The Tab key position.
Backspace = 44
The Backspace key position.
LeftShift = 45
The LeftShift key position.
RightShift = 46
The RightShift key position.
LeftControl = 47
The LeftControl key position.
RightControl = 48
The RightControl key position.
LeftAlt = 49
The LeftAlt key position.
RightAlt = 50
The RightAlt key position.
F1 = 51
The F1 key position.
F2 = 52
The F2 key position.
F3 = 53
The F3 key position.
F4 = 54
The F4 key position.
F5 = 55
The F5 key position.
F6 = 56
The F6 key position.
F7 = 57
The F7 key position.
F8 = 58
The F8 key position.
F9 = 59
The F9 key position.
F10 = 60
The F10 key position.
F11 = 61
The F11 key position.
F12 = 62
The F12 key position.
Minus = 63
The Minus key position.
Equal = 64
The Equal key position.
BracketLeft = 65
The BracketLeft key position.
BracketRight = 66
The BracketRight key position.
Semicolon = 67
The Semicolon key position.
Quote = 68
The Quote key position.
Backquote = 69
The Backquote key position.
Backslash = 70
The Backslash key position.
Comma = 71
The Comma key position.
Period = 72
The Period key position.
Slash = 73
The Slash key position.
Home = 74
The Home key position.
End = 75
The End key position.
PageUp = 76
The PageUp key position.
PageDown = 77
The PageDown key position.
Insert = 78
The Insert key position.
Delete = 79
The Delete key position.
CapsLock = 80
The CapsLock key position.
Numpad0 = 81
The Numpad0 key position.
Numpad1 = 82
The Numpad1 key position.
Numpad2 = 83
The Numpad2 key position.
Numpad3 = 84
The Numpad3 key position.
Numpad4 = 85
The Numpad4 key position.
Numpad5 = 86
The Numpad5 key position.
Numpad6 = 87
The Numpad6 key position.
Numpad7 = 88
The Numpad7 key position.
Numpad8 = 89
The Numpad8 key position.
Numpad9 = 90
The Numpad9 key position.
NumpadAdd = 91
The NumpadAdd key position.
NumpadSubtract = 92
The NumpadSubtract key position.
NumpadMultiply = 93
The NumpadMultiply key position.
NumpadDivide = 94
The NumpadDivide key position.
NumpadDecimal = 95
The NumpadDecimal key position.
NumpadEnter = 96
The NumpadEnter key position.
NumLock = 97
The NumLock key position.
Trait Implementations§
impl Copy for Key
impl Eq for Key
Source§impl From<Key> for ButtonBinding
impl From<Key> for ButtonBinding
Source§impl InputAction for Key
impl InputAction for Key
Source§type Binding = ButtonBinding
type Binding = ButtonBinding
rebind fail to compile.Source§fn defaults(&self) -> Vec<ButtonBinding>
fn defaults(&self) -> Vec<ButtonBinding>
Source§fn all() -> Vec<Self>
fn all() -> Vec<Self>
Source§impl InputActions for Key
impl InputActions for Key
Source§impl InputButtonAction for Key
A key is its own action, bound to itself: the vocabulary a prototype
reads through before it has declared what the player does.
impl InputButtonAction for Key
A key is its own action, bound to itself: the vocabulary a prototype reads through before it has declared what the player does.
Source§fn bindings(&self) -> Vec<ButtonBinding>
fn bindings(&self) -> Vec<ButtonBinding>
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
Blanket Implementations§
impl<T> AsId for T
impl<T> AsIdSalt for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§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 Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more