Key

Enum Key 

Source
pub enum Key {
Show 99 variants Unknow = 0, BackSpace = 8, Tab = 9, Enter = 13, Shift = 16, Ctrl = 17, Alt = 18, Pause = 19, CapsLock = 20, Escape = 27, PageUp = 33, PageDown = 34, End = 35, Home = 36, LeftArrow = 37, UpArrow = 38, RightArrow = 39, DownArrow = 40, Insert = 45, Delete = 46, Zero = 48, One = 49, Two = 50, Three = 51, Four = 52, Five = 53, Six = 54, Seven = 55, Eight = 56, Nine = 57, A = 65, B = 66, C = 67, D = 68, E = 69, F = 70, G = 71, H = 72, I = 73, J = 74, K = 75, L = 76, M = 77, N = 78, O = 79, P = 80, Q = 81, R = 82, S = 83, T = 84, U = 85, V = 86, W = 87, X = 88, Y = 89, Z = 90, LeftWindowKey = 91, RightWindowKey = 92, SelectKey = 93, Numpad0 = 96, Numpad1 = 97, Numpad2 = 98, Numpad3 = 99, Numpad4 = 100, Numpad5 = 101, Numpad6 = 102, Numpad7 = 103, Numpad8 = 104, Numpad9 = 105, Multiply = 106, Add = 107, Subtract = 109, DecimalPoint = 110, Divide = 111, F1 = 112, F2 = 113, F3 = 114, F4 = 115, F5 = 116, F6 = 117, F7 = 118, F8 = 119, F9 = 120, F10 = 121, F11 = 122, F12 = 123, NumLock = 144, ScrollLock = 145, SemiColon = 186, EqualSign = 187, Comma = 188, Dash = 189, Period = 190, ForwardSlash = 191, GraveAccent = 192, OpenBracket = 219, BackSlash = 220, CloseBraket = 221, SingleQuote = 222,
}
Expand description

An enum representing all the keys of a keyboard (normally)

Variants§

§

Unknow = 0

§

BackSpace = 8

§

Tab = 9

§

Enter = 13

§

Shift = 16

§

Ctrl = 17

§

Alt = 18

§

Pause = 19

§

CapsLock = 20

§

Escape = 27

§

PageUp = 33

§

PageDown = 34

§

End = 35

§

Home = 36

§

LeftArrow = 37

§

UpArrow = 38

§

RightArrow = 39

§

DownArrow = 40

§

Insert = 45

§

Delete = 46

§

Zero = 48

§

One = 49

§

Two = 50

§

Three = 51

§

Four = 52

§

Five = 53

§

Six = 54

§

Seven = 55

§

Eight = 56

§

Nine = 57

§

A = 65

§

B = 66

§

C = 67

§

D = 68

§

E = 69

§

F = 70

§

G = 71

§

H = 72

§

I = 73

§

J = 74

§

K = 75

§

L = 76

§

M = 77

§

N = 78

§

O = 79

§

P = 80

§

Q = 81

§

R = 82

§

S = 83

§

T = 84

§

U = 85

§

V = 86

§

W = 87

§

X = 88

§

Y = 89

§

Z = 90

§

LeftWindowKey = 91

§

RightWindowKey = 92

§

SelectKey = 93

§

Numpad0 = 96

§

Numpad1 = 97

§

Numpad2 = 98

§

Numpad3 = 99

§

Numpad4 = 100

§

Numpad5 = 101

§

Numpad6 = 102

§

Numpad7 = 103

§

Numpad8 = 104

§

Numpad9 = 105

§

Multiply = 106

§

Add = 107

§

Subtract = 109

§

DecimalPoint = 110

§

Divide = 111

§

F1 = 112

§

F2 = 113

§

F3 = 114

§

F4 = 115

§

F5 = 116

§

F6 = 117

§

F7 = 118

§

F8 = 119

§

F9 = 120

§

F10 = 121

§

F11 = 122

§

F12 = 123

§

NumLock = 144

§

ScrollLock = 145

§

SemiColon = 186

§

EqualSign = 187

§

Comma = 188

§

Dash = 189

§

Period = 190

§

ForwardSlash = 191

§

GraveAccent = 192

§

OpenBracket = 219

§

BackSlash = 220

§

CloseBraket = 221

§

SingleQuote = 222

Trait Implementations§

Source§

impl Debug for Key

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<u32> for Key

Source§

fn from(key_code: u32) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Key

Source§

fn eq(&self, other: &Key) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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 UnwindSafe for Key

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.