Skip to main content

Key

Enum Key 

Source
#[non_exhaustive]
#[repr(u32)]
pub enum Key {
Show 176 variants Unidentified = 0, Backquote = 1, Backslash = 2, BracketLeft = 3, BracketRight = 4, Comma = 5, Digit0 = 6, Digit1 = 7, Digit2 = 8, Digit3 = 9, Digit4 = 10, Digit5 = 11, Digit6 = 12, Digit7 = 13, Digit8 = 14, Digit9 = 15, Equal = 16, IntlBackslash = 17, IntlRo = 18, IntlYen = 19, A = 20, B = 21, C = 22, D = 23, E = 24, F = 25, G = 26, H = 27, I = 28, J = 29, K = 30, L = 31, M = 32, N = 33, O = 34, P = 35, Q = 36, R = 37, S = 38, T = 39, U = 40, V = 41, W = 42, X = 43, Y = 44, Z = 45, Minus = 46, Period = 47, Quote = 48, Semicolon = 49, Slash = 50, AltLeft = 51, AltRight = 52, Backspace = 53, CapsLock = 54, ContextMenu = 55, ControlLeft = 56, ControlRight = 57, Enter = 58, MetaLeft = 59, MetaRight = 60, ShiftLeft = 61, ShiftRight = 62, Space = 63, Tab = 64, Convert = 65, KanaMode = 66, NonConvert = 67, Delete = 68, End = 69, Help = 70, Home = 71, Insert = 72, PageDown = 73, PageUp = 74, ArrowDown = 75, ArrowLeft = 76, ArrowRight = 77, ArrowUp = 78, NumLock = 79, Numpad0 = 80, Numpad1 = 81, Numpad2 = 82, Numpad3 = 83, Numpad4 = 84, Numpad5 = 85, Numpad6 = 86, Numpad7 = 87, Numpad8 = 88, Numpad9 = 89, NumpadAdd = 90, NumpadBackspace = 91, NumpadClear = 92, NumpadClearEntry = 93, NumpadComma = 94, NumpadDecimal = 95, NumpadDivide = 96, NumpadEnter = 97, NumpadEqual = 98, NumpadMemoryAdd = 99, NumpadMemoryClear = 100, NumpadMemoryRecall = 101, NumpadMemoryStore = 102, NumpadMemorySubtract = 103, NumpadMultiply = 104, NumpadParenLeft = 105, NumpadParenRight = 106, NumpadSubtract = 107, NumpadSeparator = 108, NumpadUp = 109, NumpadDown = 110, NumpadRight = 111, NumpadLeft = 112, NumpadBegin = 113, NumpadHome = 114, NumpadEnd = 115, NumpadInsert = 116, NumpadDelete = 117, NumpadPageUp = 118, NumpadPageDown = 119, Escape = 120, F1 = 121, F2 = 122, F3 = 123, F4 = 124, F5 = 125, F6 = 126, F7 = 127, F8 = 128, F9 = 129, F10 = 130, F11 = 131, F12 = 132, F13 = 133, F14 = 134, F15 = 135, F16 = 136, F17 = 137, F18 = 138, F19 = 139, F20 = 140, F21 = 141, F22 = 142, F23 = 143, F24 = 144, F25 = 145, Fn = 146, FnLock = 147, PrintScreen = 148, ScrollLock = 149, Pause = 150, BrowserBack = 151, BrowserFavorites = 152, BrowserForward = 153, BrowserHome = 154, BrowserRefresh = 155, BrowserSearch = 156, BrowserStop = 157, Eject = 158, LaunchApp1 = 159, LaunchApp2 = 160, LaunchMail = 161, MediaPlayPause = 162, MediaSelect = 163, MediaStop = 164, MediaTrackNext = 165, MediaTrackPrevious = 166, Power = 167, Sleep = 168, AudioVolumeDown = 169, AudioVolumeMute = 170, AudioVolumeUp = 171, WakeUp = 172, Copy = 173, Cut = 174, Paste = 175,
}

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

Unidentified = 0

§

Backquote = 1

§

Backslash = 2

§

BracketLeft = 3

§

BracketRight = 4

§

Comma = 5

§

Digit0 = 6

§

Digit1 = 7

§

Digit2 = 8

§

Digit3 = 9

§

Digit4 = 10

§

Digit5 = 11

§

Digit6 = 12

§

Digit7 = 13

§

Digit8 = 14

§

Digit9 = 15

§

Equal = 16

§

IntlBackslash = 17

§

IntlRo = 18

§

IntlYen = 19

§

A = 20

§

B = 21

§

C = 22

§

D = 23

§

E = 24

§

F = 25

§

G = 26

§

H = 27

§

I = 28

§

J = 29

§

K = 30

§

L = 31

§

M = 32

§

N = 33

§

O = 34

§

P = 35

§

Q = 36

§

R = 37

§

S = 38

§

T = 39

§

U = 40

§

V = 41

§

W = 42

§

X = 43

§

Y = 44

§

Z = 45

§

Minus = 46

§

Period = 47

§

Quote = 48

§

Semicolon = 49

§

Slash = 50

§

AltLeft = 51

§

AltRight = 52

§

Backspace = 53

§

CapsLock = 54

§

ContextMenu = 55

§

ControlLeft = 56

§

ControlRight = 57

§

Enter = 58

§

MetaLeft = 59

§

MetaRight = 60

§

ShiftLeft = 61

§

ShiftRight = 62

§

Space = 63

§

Tab = 64

§

Convert = 65

§

KanaMode = 66

§

NonConvert = 67

§

Delete = 68

§

End = 69

§

Help = 70

§

Home = 71

§

Insert = 72

§

PageDown = 73

§

PageUp = 74

§

ArrowDown = 75

§

ArrowLeft = 76

§

ArrowRight = 77

§

ArrowUp = 78

§

NumLock = 79

§

Numpad0 = 80

§

Numpad1 = 81

§

Numpad2 = 82

§

Numpad3 = 83

§

Numpad4 = 84

§

Numpad5 = 85

§

Numpad6 = 86

§

Numpad7 = 87

§

Numpad8 = 88

§

Numpad9 = 89

§

NumpadAdd = 90

§

NumpadBackspace = 91

§

NumpadClear = 92

§

NumpadClearEntry = 93

§

NumpadComma = 94

§

NumpadDecimal = 95

§

NumpadDivide = 96

§

NumpadEnter = 97

§

NumpadEqual = 98

§

NumpadMemoryAdd = 99

§

NumpadMemoryClear = 100

§

NumpadMemoryRecall = 101

§

NumpadMemoryStore = 102

§

NumpadMemorySubtract = 103

§

NumpadMultiply = 104

§

NumpadParenLeft = 105

§

NumpadParenRight = 106

§

NumpadSubtract = 107

§

NumpadSeparator = 108

§

NumpadUp = 109

§

NumpadDown = 110

§

NumpadRight = 111

§

NumpadLeft = 112

§

NumpadBegin = 113

§

NumpadHome = 114

§

NumpadEnd = 115

§

NumpadInsert = 116

§

NumpadDelete = 117

§

NumpadPageUp = 118

§

NumpadPageDown = 119

§

Escape = 120

§

F1 = 121

§

F2 = 122

§

F3 = 123

§

F4 = 124

§

F5 = 125

§

F6 = 126

§

F7 = 127

§

F8 = 128

§

F9 = 129

§

F10 = 130

§

F11 = 131

§

F12 = 132

§

F13 = 133

§

F14 = 134

§

F15 = 135

§

F16 = 136

§

F17 = 137

§

F18 = 138

§

F19 = 139

§

F20 = 140

§

F21 = 141

§

F22 = 142

§

F23 = 143

§

F24 = 144

§

F25 = 145

§

Fn = 146

§

FnLock = 147

§

PrintScreen = 148

§

ScrollLock = 149

§

Pause = 150

§

BrowserBack = 151

§

BrowserFavorites = 152

§

BrowserForward = 153

§

BrowserHome = 154

§

BrowserRefresh = 155

§

BrowserSearch = 156

§

BrowserStop = 157

§

Eject = 158

§

LaunchApp1 = 159

§

LaunchApp2 = 160

§

LaunchMail = 161

§

MediaPlayPause = 162

§

MediaSelect = 163

§

MediaStop = 164

§

MediaTrackNext = 165

§

MediaTrackPrevious = 166

§

Power = 167

§

Sleep = 168

§

AudioVolumeDown = 169

§

AudioVolumeMute = 170

§

AudioVolumeUp = 171

§

WakeUp = 172

§

Copy = 173

§

Cut = 174

§

Paste = 175

Trait Implementations§

Source§

impl Clone for Key

Source§

fn clone(&self) -> Key

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
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<Key> for u32

Source§

fn from(v: Key) -> 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 TryFrom<u32> for Key

Source§

type Error = u32

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

fn try_from(v: u32) -> Result<Self, u32>

Performs the conversion.
Source§

impl Copy for Key

Source§

impl Eq for Key

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 UnsafeUnpin 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> 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.