#[non_exhaustive]
pub enum KeyCode {
Show 120 variants AltLeft = 0, AltRight = 1, ArrowDown = 2, ArrowLeft = 3, ArrowRight = 4, ArrowUp = 5, BackSlash = 6, Backspace = 7, BackTick = 8, BracketSquareLeft = 9, BracketSquareRight = 10, Break = 11, CapsLock = 12, Comma = 13, ControlLeft = 14, ControlRight = 15, Delete = 16, End = 17, Enter = 18, Escape = 19, Equals = 20, F1 = 21, F2 = 22, F3 = 23, F4 = 24, F5 = 26, F6 = 27, F7 = 28, F8 = 29, F9 = 30, F10 = 31, F11 = 32, F12 = 33, Fullstop = 34, Home = 36, Insert = 37, Key1 = 38, Key2 = 39, Key3 = 40, Key4 = 41, Key5 = 42, Key6 = 43, Key7 = 44, Key8 = 46, Key9 = 47, Key0 = 48, Menus = 49, Minus = 50, Numpad0 = 51, Numpad1 = 52, Numpad2 = 53, Numpad3 = 54, Numpad4 = 56, Numpad5 = 57, Numpad6 = 58, Numpad7 = 59, Numpad8 = 60, Numpad9 = 61, NumpadEnter = 62, NumpadLock = 63, NumpadSlash = 64, NumpadStar = 66, NumpadMinus = 67, NumpadPeriod = 68, NumpadPlus = 69, PageDown = 70, PageUp = 71, PauseBreak = 72, PrintScreen = 73, ScrollLock = 74, SemiColon = 76, ShiftLeft = 77, ShiftRight = 78, Slash = 79, Spacebar = 80, SysReq = 81, Tab = 82, Quote = 83, WindowsLeft = 84, WindowsRight = 86, A = 87, B = 88, C = 89, D = 90, E = 91, F = 92, G = 93, H = 94, I = 96, J = 97, K = 98, L = 99, M = 100, N = 101, O = 102, P = 103, Q = 104, R = 106, S = 107, T = 108, U = 109, V = 110, W = 111, X = 112, Y = 113, Z = 114, HashTilde = 115, PrevTrack = 116, NextTrack = 117, Mute = 118, Calculator = 119, Play = 120, Stop = 121, VolumeDown = 122, VolumeUp = 123, WWWHome = 124, PowerOnTestOk = 125, Oem102 = 126, PrintScreen2 = 127, TooManyKeys = 128,
}
Expand description

Keycodes that can be generated by a keyboard.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

AltLeft = 0

§

AltRight = 1

§

ArrowDown = 2

§

ArrowLeft = 3

§

ArrowRight = 4

§

ArrowUp = 5

§

BackSlash = 6

§

Backspace = 7

§

BackTick = 8

§

BracketSquareLeft = 9

§

BracketSquareRight = 10

§

Break = 11

§

CapsLock = 12

§

Comma = 13

§

ControlLeft = 14

§

ControlRight = 15

§

Delete = 16

§

End = 17

§

Enter = 18

§

Escape = 19

§

Equals = 20

§

F1 = 21

§

F2 = 22

§

F3 = 23

§

F4 = 24

§

F5 = 26

§

F6 = 27

§

F7 = 28

§

F8 = 29

§

F9 = 30

§

F10 = 31

§

F11 = 32

§

F12 = 33

§

Fullstop = 34

§

Home = 36

§

Insert = 37

§

Key1 = 38

§

Key2 = 39

§

Key3 = 40

§

Key4 = 41

§

Key5 = 42

§

Key6 = 43

§

Key7 = 44

§

Key8 = 46

§

Key9 = 47

§

Key0 = 48

§

Menus = 49

§

Minus = 50

§

Numpad0 = 51

§

Numpad1 = 52

§

Numpad2 = 53

§

Numpad3 = 54

§

Numpad4 = 56

§

Numpad5 = 57

§

Numpad6 = 58

§

Numpad7 = 59

§

Numpad8 = 60

§

Numpad9 = 61

§

NumpadEnter = 62

§

NumpadLock = 63

§

NumpadSlash = 64

§

NumpadStar = 66

§

NumpadMinus = 67

§

NumpadPeriod = 68

§

NumpadPlus = 69

§

PageDown = 70

§

PageUp = 71

§

PauseBreak = 72

§

PrintScreen = 73

§

ScrollLock = 74

§

SemiColon = 76

§

ShiftLeft = 77

§

ShiftRight = 78

§

Slash = 79

§

Spacebar = 80

§

SysReq = 81

§

Tab = 82

§

Quote = 83

§

WindowsLeft = 84

§

WindowsRight = 86

§

A = 87

§

B = 88

§

C = 89

§

D = 90

§

E = 91

§

F = 92

§

G = 93

§

H = 94

§

I = 96

§

J = 97

§

K = 98

§

L = 99

§

M = 100

§

N = 101

§

O = 102

§

P = 103

§

Q = 104

§

R = 106

§

S = 107

§

T = 108

§

U = 109

§

V = 110

§

W = 111

§

X = 112

§

Y = 113

§

Z = 114

§

HashTilde = 115

The key to the left of the 102/105-key “Tall Return” Key - not on 101/104-key keyboards

§

PrevTrack = 116

§

NextTrack = 117

§

Mute = 118

§

Calculator = 119

§

Play = 120

§

Stop = 121

§

VolumeDown = 122

§

VolumeUp = 123

§

WWWHome = 124

§

PowerOnTestOk = 125

Sent when the keyboard boots

§

Oem102 = 126

Used for <> on DE layouts

§

PrintScreen2 = 127

PrintScreen comes in two parts - this is the second

§

TooManyKeys = 128

Sent by the keyboard when too many keys are pressed

Trait Implementations§

§

impl Clone for KeyCode

§

fn clone(&self) -> KeyCode

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
§

impl Debug for KeyCode

§

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

Formats the value using the given formatter. Read more
§

impl Ord for KeyCode

§

fn cmp(&self, other: &KeyCode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for KeyCode

§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl PartialOrd for KeyCode

§

fn partial_cmp(&self, other: &KeyCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Copy for KeyCode

§

impl Eq for KeyCode

§

impl StructuralEq for KeyCode

§

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> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.