Enum tetra::input::Key [−][src]
pub enum Key {
Show 129 variants
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,
Num0,
Num1,
Num2,
Num3,
Num4,
Num5,
Num6,
Num7,
Num8,
Num9,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
F21,
F22,
F23,
F24,
NumLock,
NumPad1,
NumPad2,
NumPad3,
NumPad4,
NumPad5,
NumPad6,
NumPad7,
NumPad8,
NumPad9,
NumPad0,
NumPadPlus,
NumPadMinus,
NumPadMultiply,
NumPadDivide,
NumPadEnter,
LeftCtrl,
LeftShift,
LeftAlt,
RightCtrl,
RightShift,
RightAlt,
Up,
Down,
Left,
Right,
Backquote,
Backslash,
Backspace,
CapsLock,
Comma,
Delete,
End,
Enter,
Equals,
Escape,
Home,
Insert,
LeftBracket,
Minus,
PageDown,
PageUp,
Pause,
Period,
PrintScreen,
Quote,
RightBracket,
ScrollLock,
Semicolon,
Slash,
Space,
Tab,
Ampersand,
Asterisk,
At,
Caret,
Colon,
Dollar,
DoubleQuote,
Exclaim,
GreaterThan,
Hash,
LeftParen,
LessThan,
Percent,
Plus,
Question,
RightParen,
Underscore,
}
Expand description
A physical key on a keyboard.
This type represents keys based on their physical position, independent from the user’s
active keyboard layout. The variants are named based on how the keys are labelled on a
US QWERTY keyboard. For example, Key::A
is the key to the right of the Caps Lock,
even if the user is on an AZERTY keyboard.
This is used as the default representation as it allows non-QWERTY keyboard layouts to be supported with minimal effort on the developer’s part. However, you should consider providing configurable input bindings too, for maximum accessibility.
If you need to determine what a key represents in the current keyboard layout (e.g.
to display button prompts, or for a config screen), you can use the get_key_label
function.
Serde
Serialization and deserialization of this type (via Serde)
can be enabled via the serde_support
feature.
Variants
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Key
now represents the physical position of a key, independent of the current keyboard layout, so this variant is no longer valid. To represent the key that is labelled with this character, use KeyLabel
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Key
impl UnwindSafe for Key
Blanket Implementations
Mutably borrows from an owned value. Read more