Enum Key

Source
pub enum Key {
Show 108 variants A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8, Num9, Num0, NumPad1, NumPad2, NumPad3, NumPad4, NumPad5, NumPad6, NumPad7, NumPad8, NumPad9, NumPad0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, Shift, Ctrl, Alt, Backtick, Comma, Dot, Slash, Semicolon, Apostrophe, LeftBracket, RightBracket, Backslash, Minus, Equals, NumAdd, NumSub, NumMul, NumDiv, NumDot, Tab, Space, Enter, Backspace, Esc, CapsLock, LeftCtrl, LeftShift, LeftAlt, RightCtrl, RightShift, RightAlt, ScrollLock, NumLock, Delete, Insert, Home, End, PageUp, PageDown, Clear, LeftButton, RightButton, MiddleButton, X1Button, X2Button, Left, Right, Up, Down, Unknown(i32),
}
Expand description

按键标识

此枚举标识(美式)键盘上所有的按键

Variants§

§

A

A

§

B

B

§

C

C

§

D

D

§

E

E

§

F

F

§

G

G

§

H

H

§

I

I

§

J

J

§

K

K

§

L

L

§

M

M

§

N

N

§

O

O

§

P

P

§

Q

Q

§

R

R

§

S

S

§

T

T

§

U

U

§

V

V

§

W

W

§

X

X

§

Y

Y

§

Z

Z

§

Num1

1

§

Num2

2

§

Num3

3

§

Num4

4

§

Num5

5

§

Num6

6

§

Num7

7

§

Num8

8

§

Num9

9

§

Num0

0

§

NumPad1

NumPad 1

§

NumPad2

NumPad 2

§

NumPad3

NumPad 3

§

NumPad4

NumPad 4

§

NumPad5

NumPad 5

§

NumPad6

NumPad 6

§

NumPad7

NumPad 7

§

NumPad8

NumPad 8

§

NumPad9

NumPad 9

§

NumPad0

NumPad 0

§

F1

F1

§

F2

F2

§

F3

F3

§

F4

F4

§

F5

F5

§

F6

F6

§

F7

F7

§

F8

F8

§

F9

F9

§

F10

F10

§

F11

F11

§

F12

F12

§

Shift

Shift

§

Ctrl

Ctrl

§

Alt

Alt

§

Backtick

`

§

Comma

,

§

Dot

.

§

Slash

/

§

Semicolon

;

§

Apostrophe

§

LeftBracket

[

§

RightBracket

]

§

Backslash

\

§

Minus

§

Equals

=

§

NumAdd

NumPad +

§

NumSub

NumPad -

§

NumMul

NumPad *

§

NumDiv

NumPad /

§

NumDot

NumPad .

§

Tab

Tab

§

Space

Space

§

Enter

Enter

§

Backspace

Backspace

§

Esc

Esc

§

CapsLock

CapsLock

§

LeftCtrl

Left Ctrl

§

LeftShift

Left Shift

§

LeftAlt

Left Alt

§

RightCtrl

Right Ctrl

§

RightShift

Right Shift

§

RightAlt

Right Alt

§

ScrollLock

ScrollLock

§

NumLock

NumLock

§

Delete

Delete

§

Insert

Insert

§

Home

Home

§

End

End

§

PageUp

PageUp

§

PageDown

PageDown

§

Clear

Clear

§

LeftButton

Left mouse button

§

RightButton

Right mouse button

§

MiddleButton

Middle mouse button

§

X1Button

Mouse extension button 1

§

X2Button

Mouse extension button 2

§

Left

Left arrow

§

Right

Right arrow

§

Up

Up arrow

§

Down

Down arrow

§

Unknown(i32)

Unknown key

Trait Implementations§

Source§

impl Clone for Key

Source§

fn clone(&self) -> Key

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

impl Debug for Key

Source§

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

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

impl Hash for Key

Source§

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

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

Source§

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

Restrict a value to a certain interval. Read more
Source§

impl PartialEq<char> for Key

Source§

fn eq(&self, other: &char) -> 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 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 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, 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.