Enum Key

Source
pub enum Key {
Show 110 variants Escape, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PrintScreen, Pause, ScrollLock, A1, A2, A3, Mode, Tilde, One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Zero, Dash, Equals, Backspace, Insert, Home, PageUp, NumLock, NumDivide, NumMultiply, NumSubtract, Tab, Q, W, E, R, T, Y, U, I, O, P, LeftBracket, RightBracket, Backslash, Delete, End, PageDown, NumSeven, NumEight, NumNine, NumAddition, CapsLock, A, S, D, F, G, H, J, K, L, SemiColon, Apostrophe, ISO1, Return, NumFour, NumFive, NumSix, LeftShift, ISO2, Z, X, C, V, B, N, M, Comma, Period, ForwardSlash, RightShift, UpArrow, NumOne, NumTwo, NumThree, NumReturn, LeftControl, LeftMod, LeftAlt, Space, RightAlt, RightMod, Fn, RightControl, LeftArrow, DownArrow, RightArrow, NumZero, NumDelete,
}
Expand description

Represents a key on the keyboard.

Variants§

§

Escape

Escape key (Esc). Generates the escape character (ASCII 27).

§

F1

Function key (F1). Normally programmed to cause an operating system or application to perform certain actions.

§

F2

Function key (F2). Normally programmed to cause an operating system or application to perform certain actions.

§

F3

Function key (F3). Normally programmed to cause an operating system or application to perform certain actions.

§

F4

Function key (F4). Normally programmed to cause an operating system or application to perform certain actions.

§

F5

Function key (F5). Normally programmed to cause an operating system or application to perform certain actions.

§

F6

Function key (F6). Normally programmed to cause an operating system or application to perform certain actions.

§

F7

Function key (F7). Normally programmed to cause an operating system or application to perform certain actions.

§

F8

Function key (F8). Normally programmed to cause an operating system or application to perform certain actions.

§

F9

Function key (F9). Normally programmed to cause an operating system or application to perform certain actions.

§

F10

Function key (F10). Normally programmed to cause an operating system or application to perform certain actions.

§

F11

Function key (F11). Normally programmed to cause an operating system or application to perform certain actions.

§

F12

Function key (F12). Normally programmed to cause an operating system or application to perform certain actions.

§

PrintScreen

Print screen key (Prt Sc). May share the same key as system request. Normally takes a screenshot.

§

Pause

Pause (or break) key. Has no well defined purpose.

§

ScrollLock

Scroll lock key (Scr Lk). Has different functions or purposes depending on the application or operating system. Originally intended to make arrow keys scroll the current window contents instead of moving the cursor.

§

A1

Analog profile key (A1). Switches to analog profile one.

§

A2

Analog profile key (A2). Switches to analog profile two.

§

A3

Analog profile key (A3). Switches to analog profile three.

§

Mode

Mode key. Toggles between digital and analog modes.

§

Tilde

Tilde key (~).

§

One

Number one key (1).

§

Two

Number two key (2).

§

Three

Number three key (3).

§

Four

Number four key (4).

§

Five

Number five key (5).

§

Six

Number six key (6).

§

Seven

Number seven key (7).

§

Eight

Number eight key (8).

§

Nine

Number nine key (9).

§

Zero

Number zero key (0).

§

Dash

Dash or hyphen key (-).

§

Equals

Equals key (=).

§

Backspace

Backspace key. Moves display cursor one position backwards, deleting the character at that position and shifting back the text after that position by one position.

§

Insert

Insert key (Ins). Switches between two text entry modes - overtype or insert. Overtype mode replaces the character present in the current location. Insert mode inserts a character at the current position, forcing all characters past it one position further.

§

Home

Home key. Has the opposite effect of the end key.

§

PageUp

Page up key (Pg Up). Scrolls up in documents.

§

NumLock

Number lock key (Num). Affects the function of the numeric keypad located to the right of the main keyboard.

§

NumDivide

Divide key on the numpad (/). Types a forward slash or acts as a divison key in calculator applications.

§

NumMultiply

Multiply key on the numpad (*). Types a star or acts as a multiplication key in calculator applications.

§

NumSubtract

Subtract key on the numpad (-). Types a dash or acts as a subtraction key in calculator applications.

§

Tab

Tab key. Advances cursor to next tab stop.

§

Q

Letter q key.

§

W

Letter w key.

§

E

Letter e key.

§

R

Letter r key.

§

T

Letter t key.

§

Y

Letter y key.

§

U

Letter u key.

§

I

Letter i key.

§

O

Letter o key.

§

P

Letter p key.

§

LeftBracket

Left square bracket key ([).

§

RightBracket

Right square bracket key (]).

§

Backslash

Backslash key (\).

§

Delete

Delete key (Del). Deletes the character in the position after the cursor.

§

End

End key. Has the opposite effect of the home key.

§

PageDown

Page down key (Pg Dn). Scrolls down in documents.

§

NumSeven

Number seven key (7) on the numpad.

§

NumEight

Number eight key (8) on the numpad.

§

NumNine

Number nine key (9) on the numpad.

§

NumAddition

Addition key on the numpad (+). Types a plus or acts as a addition key in calculator applications.

§

CapsLock

Capitalization lock key. Causes all letters in latin-based scripts to be generated in capitals.

§

A

Letter a key.

§

S

Letter s key.

§

D

Letter d key.

§

F

Letter f key.

§

G

Letter g key.

§

H

Letter h key.

§

J

Letter j key.

§

K

Letter k key.

§

L

Letter l key.

§

SemiColon

Semi-colon key (;).

§

Apostrophe

Apostrophe key (').

§

ISO1

Represents a key that is specific to the keyboard layout. This key is positioned above the return key or to the left of the return key. On UK layouts, this is a pound (#) key. On US layouts, this is a backslash key. This key has the same scan index as the backslash key.

§

Return

Return (or enter) key.

§

NumFour

Number four key (4) on the numpad.

§

NumFive

Number five key (5) on the numpad.

§

NumSix

Number six key (6) on the numpad.

§

LeftShift

Left shift modifier key. Used to type capital letters and other alternate “upper” characters.

§

ISO2

Represents a key that is specific to the keyboard layout. This key is positioned to the right of the left shift key. On UK layouts, this is a backslash key. On US layouts, this key does not exist.

§

Z

Letter z key.

§

X

Letter x key.

§

C

Letter c key.

§

V

Letter v key.

§

B

Letter b key.

§

N

Letter n key.

§

M

Letter m key.

§

Comma

Comma key (,).

§

Period

Period key (.).

§

ForwardSlash

Forward slash key (/).

§

RightShift

Right shift modifier key. Performs the same function as left shift.

§

UpArrow

Up arrow key. Moves the cursor in the upwards direction.

§

NumOne

Number one key (1) on the numpad.

§

NumTwo

Number two key (2) on the numpad.

§

NumThree

Number three key (3) on the numpad.

§

NumReturn

Return (or enter) key on the numpad. Performs the same function as the normal return key.

§

LeftControl

Left control modifier key. Performs a special operation when pressed in conjunction with another key.

§

LeftMod

Left mod (or Windows) modifier key. Normally invokes the operating system’s start menu.

§

LeftAlt

Left alt modifier key. Used to change (alternate) the function of other pressed keys.

§

Space

Space key ( ).

§

RightAlt

Right alt modifier key. Performs the same function as left alt.

§

RightMod

Right mod modifier key. Performs the same function as left mod.

§

Fn

Function key (Fn). Performs an alternative operation for some keys, normally defined by the keyboard and indicated by symbols on the key.

§

RightControl

Right control modifier key. Performs the same function as left control.

§

LeftArrow

Left arrow key. Moves the cursor in the left direction.

§

DownArrow

Down arrow key. Moves the cursor in the down direction.

§

RightArrow

Right arrow key. Moves the cursor in the right direction.

§

NumZero

Number zero key (0) on the numpad.

§

NumDelete

Delete key (Del) on the numpad. Performs the same function as the normal delete 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 Display for Key

Source§

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

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

impl FromScanIndex for Key

Source§

fn from_scan_index(index: u8) -> Option<Self>

Return the key that corresponds to the provided scan index, if any.

Source§

impl Hash for Key

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

Source§

fn into_matrix_row_and_column(&self) -> (u8, u8)

Returns a tuple (row, column) that represents the matrix row and column of the key.

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 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 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.