Enum Key

Source
pub enum Key {
Show 103 variants Escape, Main1, Main2, Main3, Main4, Main5, Main6, Main7, Main8, Main9, Main0, Minus, Equals, Backspace, Tabulation, Q, W, E, R, T, Y, U, I, O, P, LeftBracket, RightBracket, Enter, LeftControl, A, S, D, F, G, H, J, K, L, Semicolon, Apostrophe, Grave, LeftShift, Backslash, Z, X, C, V, B, N, M, Comma, Period, Slash, RightShift, Multiply, LeftAlt, Space, CapsLock, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, NumLock, ScrollLock, NumPad7, NumPad8, NumPad9, Subtract, NumPad4, NumPad5, NumPad6, Add, NumPad1, NumPad2, NumPad3, NumPad0, Decimal, OEM102, F11, F12, NumPadEnter, RightControl, Divide, PrintScreen, RightAlt, Pause, Home, Up, PageUp, Left, Right, End, Down, PageDown, Insert, Delete, Unknown(u8),
}
Expand description

Keyboard keys

Variants§

§

Escape

Escape key

§

Main1

‘1’ key on main keyboard

§

Main2

‘2’ key on main keyboard

§

Main3

‘3’ key on main keyboard

§

Main4

‘4’ key on main keyboard

§

Main5

‘5’ key on main keyboard

§

Main6

‘6’ key on main keyboard

§

Main7

‘7’ key on main keyboard

§

Main8

‘8’ key on main keyboard

§

Main9

‘9’ key on main keyboard

§

Main0

‘0’ key on main keyboard

§

Minus

‘-’ key on main keyboard

§

Equals

‘=’ key on main keyboard

§

Backspace

backspace key

§

Tabulation

tab key

§

Q

‘Q’ key

§

W

‘W’ key

§

E

‘E’ key

§

R

‘R’ key

§

T

‘T’ key

§

Y

‘Y’ key

§

U

‘U’ key

§

I

‘I’ key

§

O

‘O’ key

§

P

‘P’ key

§

LeftBracket

‘[’ (left bracket) key

§

RightBracket

‘]’ (right bracket) key

§

Enter

‘Enter’ key on main keyboard

§

LeftControl

Left ‘Ctrl’ key

§

A

‘A’ key

§

S

‘S’ key

§

D

‘D’ key

§

F

‘F’ key

§

G

‘G’ key

§

H

‘H’ key

§

J

‘J’ key

§

K

‘K’ key

§

L

‘L’ key

§

Semicolon

‘;’ (semicolon) key

§

Apostrophe

’ (apostrophe) key

§

Grave

accent grave

§

LeftShift

Left ‘Shift’ key

§

Backslash

’' (Backslash) key

§

Z

‘Z’ key

§

X

‘X’ key

§

C

‘C’ key

§

V

‘V’ key

§

B

‘B’ key

§

N

‘N’ key

§

M

‘M’ key

§

Comma

‘,’ (comma) key

§

Period

‘.’ key on main keyboard

§

Slash

‘/’ key on main keyboard

§

RightShift

Right ‘Shift’ key

§

Multiply

  • on numeric keypad
§

LeftAlt

left Alt

§

Space

‘Space’ key

§

CapsLock

caps lock key

§

F1

F1 function key

§

F2

F2 function key

§

F3

F3 function key

§

F4

F4 function key

§

F5

F5 function key

§

F6

F6 function key

§

F7

F7 function key

§

F8

F8 function key

§

F9

F9 function key

§

F10

F10 function key

§

NumLock

‘Num Lock’ key

§

ScrollLock

Scroll lock

§

NumPad7

‘7’ key on numeric keypad

§

NumPad8

‘8’ key on numeric keypad

§

NumPad9

‘9’ key on numeric keypad

§

Subtract

‘-’ key on numeric keypad

§

NumPad4

‘4’ key on numeric keypad

§

NumPad5

‘5’ key on numeric keypad

§

NumPad6

‘6’ key on numeric keypad

§

Add

‘+’ key on numeric keypad

§

NumPad1

‘1’ key on numeric keypad

§

NumPad2

‘2’ key on numeric keypad

§

NumPad3

‘3’ key on numeric keypad

§

NumPad0

‘0’ key on numeric keypad

§

Decimal

‘.’ key on numeric keypad

§

OEM102

| < > on UK/German keyboards

§

F11

F11 function key

§

F12

F12 function key

§

NumPadEnter

Enter on numeric keypad

§

RightControl

right Control key

§

Divide

‘/’ key on numeric keypad

§

PrintScreen

SysRq/PrtScn key

§

RightAlt

right Alt

§

Pause

Break/Pause key

§

Home

Home on cursor keypad

§

Up

up-arrow on cursor keypad

§

PageUp

PgUp on cursor keypad

§

Left

left-arrow on cursor keypad

§

Right

right-arrow on cursor keypad

§

End

End on cursor keypad

§

Down

down-arrow on cursor keypad

§

PageDown

PgDn on cursor keypad

§

Insert

Insert on cursor keypad

§

Delete

Delete on cursor keypad

§

Unknown(u8)

Unknown key

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

Source§

fn partial_cmp(&self, other: &Key) -> 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

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

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

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

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

impl Copy 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 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.