Skip to main content

KeyCode

Enum KeyCode 

Source
#[repr(u32)]
pub enum KeyCode {
Show 89 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, Key1 = 26, Key2 = 27, Key3 = 28, Key4 = 29, Key5 = 30, Key6 = 31, Key7 = 32, Key8 = 33, Key9 = 34, Key0 = 35, F1 = 36, F2 = 37, F3 = 38, F4 = 39, F5 = 40, F6 = 41, F7 = 42, F8 = 43, F9 = 44, F10 = 45, F11 = 46, F12 = 47, Space = 48, Enter = 49, Escape = 50, Tab = 51, Backspace = 52, Delete = 53, Insert = 54, Home = 55, End = 56, PageUp = 57, PageDown = 58, Up = 59, Down = 60, Left = 61, Right = 62, LeftShift = 63, RightShift = 64, LeftCtrl = 65, RightCtrl = 66, LeftAlt = 67, RightAlt = 68, LeftSuper = 69, RightSuper = 70, Semicolon = 71, Comma = 72, Period = 73, Slash = 74, Backslash = 75, LeftBracket = 76, RightBracket = 77, Equals = 78, Minus = 79, Apostrophe = 80, Backquote = 81, CapsLock = 82, ScrollLock = 83, NumLock = 84, PrintScreen = 85, Pause = 86, ContextMenu = 87, Unknown = 88,
}
Expand description

Physical keyboard key.

Covers the common keyboard layout. For full coverage, use KeyCode from the underlying windowing layer.

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

§

Key1 = 26

§

Key2 = 27

§

Key3 = 28

§

Key4 = 29

§

Key5 = 30

§

Key6 = 31

§

Key7 = 32

§

Key8 = 33

§

Key9 = 34

§

Key0 = 35

§

F1 = 36

§

F2 = 37

§

F3 = 38

§

F4 = 39

§

F5 = 40

§

F6 = 41

§

F7 = 42

§

F8 = 43

§

F9 = 44

§

F10 = 45

§

F11 = 46

§

F12 = 47

§

Space = 48

§

Enter = 49

§

Escape = 50

§

Tab = 51

§

Backspace = 52

§

Delete = 53

§

Insert = 54

§

Home = 55

§

End = 56

§

PageUp = 57

§

PageDown = 58

§

Up = 59

§

Down = 60

§

Left = 61

§

Right = 62

§

LeftShift = 63

§

RightShift = 64

§

LeftCtrl = 65

§

RightCtrl = 66

§

LeftAlt = 67

§

RightAlt = 68

§

LeftSuper = 69

§

RightSuper = 70

§

Semicolon = 71

§

Comma = 72

§

Period = 73

§

Slash = 74

§

Backslash = 75

§

LeftBracket = 76

§

RightBracket = 77

§

Equals = 78

§

Minus = 79

§

Apostrophe = 80

§

Backquote = 81

§

CapsLock = 82

§

ScrollLock = 83

§

NumLock = 84

§

PrintScreen = 85

§

Pause = 86

§

ContextMenu = 87

§

Unknown = 88

Unknown / unmapped key.

Trait Implementations§

Source§

impl Clone for KeyCode

Source§

fn clone(&self) -> KeyCode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for KeyCode

Source§

impl Debug for KeyCode

Source§

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

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

impl Eq for KeyCode

Source§

impl Hash for KeyCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for KeyCode

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for KeyCode

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.