Key

Enum Key 

Source
#[repr(C)]
pub enum Key {
Show 119 variants Unknown = -1, Space = 32, Apostrophe = 39, Comma = 44, Minus = 45, Period = 46, Slash = 47, K0 = 48, K1 = 49, K2 = 50, K3 = 51, K4 = 52, K5 = 53, K6 = 54, K7 = 55, K8 = 56, K9 = 57, Semicolon = 59, Equal = 61, 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, LeftBracket = 91, Backslash = 92, RightBracket = 93, GraveAccent = 96, Escape = 256, Enter = 257, Tab = 258, Backspace = 259, Insert = 260, Delete = 261, Right = 262, Left = 263, Down = 264, Up = 265, PageUp = 266, PageDown = 267, Home = 268, End = 269, CapsLock = 280, ScrollLock = 281, NumLock = 282, PrintScreen = 283, Pause = 284, F1 = 290, F2 = 291, F3 = 292, F4 = 293, F5 = 294, F6 = 295, F7 = 296, F8 = 297, F9 = 298, F10 = 299, F11 = 300, F12 = 301, F13 = 302, F14 = 303, F15 = 304, F16 = 305, F17 = 306, F18 = 307, F19 = 308, F20 = 309, F21 = 310, F22 = 311, F23 = 312, F24 = 313, F25 = 314, KeyPad0 = 320, KeyPad1 = 321, KeyPad2 = 322, KeyPad3 = 323, KeyPad4 = 324, KeyPad5 = 325, KeyPad6 = 326, KeyPad7 = 327, KeyPad8 = 328, KeyPad9 = 329, KeyPadDecimal = 330, KeyPadDivide = 331, KeyPadMultiply = 332, KeyPadSubtract = 333, KeyPadAdd = 334, KeyPadEnter = 335, KeyPadEqual = 336, LeftShift = 340, LeftControl = 341, LeftAlt = 342, LeftSuper = 343, RightShift = 344, RightControl = 345, RightAlt = 346, RightSuper = 347, Menu = 348,
}
Expand description

Represents a keyboard key, with each variant corresponding to a specific key code.

Variants§

§

Unknown = -1

§

Space = 32

§

Apostrophe = 39

§

Comma = 44

§

Minus = 45

§

Period = 46

§

Slash = 47

§

K0 = 48

§

K1 = 49

§

K2 = 50

§

K3 = 51

§

K4 = 52

§

K5 = 53

§

K6 = 54

§

K7 = 55

§

K8 = 56

§

K9 = 57

§

Semicolon = 59

§

Equal = 61

§

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

§

LeftBracket = 91

§

Backslash = 92

§

RightBracket = 93

§

GraveAccent = 96

§

Escape = 256

§

Enter = 257

§

Tab = 258

§

Backspace = 259

§

Insert = 260

§

Delete = 261

§

Right = 262

§

Left = 263

§

Down = 264

§

Up = 265

§

PageUp = 266

§

PageDown = 267

§

Home = 268

§

End = 269

§

CapsLock = 280

§

ScrollLock = 281

§

NumLock = 282

§

PrintScreen = 283

§

Pause = 284

§

F1 = 290

§

F2 = 291

§

F3 = 292

§

F4 = 293

§

F5 = 294

§

F6 = 295

§

F7 = 296

§

F8 = 297

§

F9 = 298

§

F10 = 299

§

F11 = 300

§

F12 = 301

§

F13 = 302

§

F14 = 303

§

F15 = 304

§

F16 = 305

§

F17 = 306

§

F18 = 307

§

F19 = 308

§

F20 = 309

§

F21 = 310

§

F22 = 311

§

F23 = 312

§

F24 = 313

§

F25 = 314

§

KeyPad0 = 320

§

KeyPad1 = 321

§

KeyPad2 = 322

§

KeyPad3 = 323

§

KeyPad4 = 324

§

KeyPad5 = 325

§

KeyPad6 = 326

§

KeyPad7 = 327

§

KeyPad8 = 328

§

KeyPad9 = 329

§

KeyPadDecimal = 330

§

KeyPadDivide = 331

§

KeyPadMultiply = 332

§

KeyPadSubtract = 333

§

KeyPadAdd = 334

§

KeyPadEnter = 335

§

KeyPadEqual = 336

§

LeftShift = 340

§

LeftControl = 341

§

LeftAlt = 342

§

LeftSuper = 343

§

RightShift = 344

§

RightControl = 345

§

RightAlt = 346

§

RightSuper = 347

§

Menu = 348

Trait Implementations§

Source§

impl Debug for Key

Source§

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

Formats the value using the given formatter. Read more

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.