Enum geng_window::Key

source ·
#[non_exhaustive]
pub enum Key {
Show 120 variants Backquote, Backslash, BracketLeft, BracketRight, Comma, Digit0, Digit1, Digit2, Digit3, Digit4, Digit5, Digit6, Digit7, Digit8, Digit9, Equal, IntlBackslash, IntlRo, IntlYen, 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, Minus, Period, Quote, Semicolon, Slash, AltLeft, AltRight, Backspace, CapsLock, ContextMenu, ControlLeft, ControlRight, Enter, SuperLeft, SuperRight, ShiftLeft, ShiftRight, Space, Tab, Delete, End, Help, Home, Insert, PageDown, PageUp, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, NumLock, Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Numpad7, Numpad8, Numpad9, NumpadAdd, NumpadBackspace, NumpadClear, NumpadClearEntry, NumpadComma, NumpadDecimal, NumpadDivide, NumpadEnter, NumpadEqual, NumpadHash, NumpadMemoryAdd, NumpadMemoryClear, NumpadMemoryRecall, NumpadMemoryStore, NumpadMemorySubtract, NumpadMultiply, NumpadParenLeft, NumpadParenRight, NumpadStar, NumpadSubtract, Escape, Back, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,
}

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

Backquote

` on a US keyboard. This is also called a backtick or grave. This is the 半角/全角/漢字 (hankaku/zenkaku/kanji) key on Japanese keyboards

§

Backslash

Used for both the US \ (on the 101-key layout) and also for the key located between the and Enter keys on row C of the 102-, 104- and 106-key layouts. Labeled # on a UK (102) keyboard.

§

BracketLeft

[ on a US keyboard.

§

BracketRight

] on a US keyboard.

§

Comma

, on a US keyboard.

§

Digit0

0 on a US keyboard.

§

Digit1

1 on a US keyboard.

§

Digit2

2 on a US keyboard.

§

Digit3

3 on a US keyboard.

§

Digit4

4 on a US keyboard.

§

Digit5

5 on a US keyboard.

§

Digit6

6 on a US keyboard.

§

Digit7

7 on a US keyboard.

§

Digit8

8 on a US keyboard.

§

Digit9

9 on a US keyboard.

§

Equal

= on a US keyboard.

§

IntlBackslash

Located between the left Shift and Z keys. Labeled \ on a UK keyboard.

§

IntlRo

Located between the / and right Shift keys. Labeled \ (ro) on a Japanese keyboard.

§

IntlYen

Located between the = and Backspace keys. Labeled ¥ (yen) on a Japanese keyboard. \ on a Russian keyboard.

§

A

a on a US keyboard. Labeled q on an AZERTY (e.g., French) keyboard.

§

B

b on a US keyboard.

§

C

c on a US keyboard.

§

D

d on a US keyboard.

§

E

e on a US keyboard.

§

F

f on a US keyboard.

§

G

g on a US keyboard.

§

H

h on a US keyboard.

§

I

i on a US keyboard.

§

J

j on a US keyboard.

§

K

k on a US keyboard.

§

L

l on a US keyboard.

§

M

m on a US keyboard.

§

N

n on a US keyboard.

§

O

o on a US keyboard.

§

P

p on a US keyboard.

§

Q

q on a US keyboard. Labeled a on an AZERTY (e.g., French) keyboard.

§

R

r on a US keyboard.

§

S

s on a US keyboard.

§

T

t on a US keyboard.

§

U

u on a US keyboard.

§

V

v on a US keyboard.

§

W

w on a US keyboard. Labeled z on an AZERTY (e.g., French) keyboard.

§

X

x on a US keyboard.

§

Y

y on a US keyboard. Labeled z on a QWERTZ (e.g., German) keyboard.

§

Z

z on a US keyboard. Labeled w on an AZERTY (e.g., French) keyboard, and y on a QWERTZ (e.g., German) keyboard.

§

Minus

- on a US keyboard.

§

Period

. on a US keyboard.

§

Quote

on a US keyboard.

§

Semicolon

; on a US keyboard.

§

Slash

/ on a US keyboard.

§

AltLeft

Alt, Option, or .

§

AltRight

Alt, Option, or . This is labeled AltGr on many keyboard layouts.

§

Backspace

Backspace or . Labeled Delete on Apple keyboards.

§

CapsLock

CapsLock or

§

ContextMenu

The application context menu key, which is typically found between the right Super key and the right Control key.

§

ControlLeft

Control or

§

ControlRight

Control or

§

Enter

Enter or . Labeled Return on Apple keyboards.

§

SuperLeft

The Windows, , Command, or other OS symbol key.

§

SuperRight

The Windows, , Command, or other OS symbol key.

§

ShiftLeft

Shift or

§

ShiftRight

Shift or

§

Space

  (space)

§

Tab

Tab or

§

Delete

. The forward delete key. Note that on Apple keyboards, the key labelled Delete on the main part of the keyboard is encoded as Backspace.

§

End

Page Down, End, or

§

Help

Help. Not present on standard PC keyboards.

§

Home

Home or

§

Insert

Insert or Ins. Not present on Apple keyboards.

§

PageDown

Page Down, PgDn, or

§

PageUp

Page Up, PgUp, or

§

ArrowDown

§

ArrowLeft

§

ArrowRight

§

ArrowUp

§

NumLock

On the Mac, this is used for the numpad Clear key.

§

Numpad0

0 Ins on a keyboard. 0 on a phone or remote control

§

Numpad1

1 End on a keyboard. 1 or 1 QZ on a phone or remote control

§

Numpad2

2 ↓ on a keyboard. 2 ABC on a phone or remote control

§

Numpad3

3 PgDn on a keyboard. 3 DEF on a phone or remote control

§

Numpad4

4 ← on a keyboard. 4 GHI on a phone or remote control

§

Numpad5

5 on a keyboard. 5 JKL on a phone or remote control

§

Numpad6

6 → on a keyboard. 6 MNO on a phone or remote control

§

Numpad7

7 Home on a keyboard. 7 PQRS or 7 PRS on a phone or remote control

§

Numpad8

8 ↑ on a keyboard. 8 TUV on a phone or remote control

§

Numpad9

9 PgUp on a keyboard. 9 WXYZ or 9 WXY on a phone or remote control

§

NumpadAdd

+

§

NumpadBackspace

Found on the Microsoft Natural Keyboard.

§

NumpadClear

C or A (All Clear). Also for use with numpads that have a Clear key that is separate from the NumLock key. On the Mac, the numpad Clear key is encoded as NumLock.

§

NumpadClearEntry

C (Clear Entry)

§

NumpadComma

, (thousands separator). For locales where the thousands separator is a “.” (e.g., Brazil), this key may generate a ..

§

NumpadDecimal

. Del. For locales where the decimal separator is “,” (e.g., Brazil), this key may generate a ,.

§

NumpadDivide

/

§

NumpadEnter

§

NumpadEqual

=

§

NumpadHash

# on a phone or remote control device. This key is typically found below the 9 key and to the right of the 0 key.

§

NumpadMemoryAdd

M Add current entry to the value stored in memory.

§

NumpadMemoryClear

M Clear the value stored in memory.

§

NumpadMemoryRecall

M Replace the current entry with the value stored in memory.

§

NumpadMemoryStore

M Replace the value stored in memory with the current entry.

§

NumpadMemorySubtract

M Subtract current entry from the value stored in memory.

§

NumpadMultiply

on a keyboard. For use with numpads that provide mathematical operations (+, - and /).

Use NumpadStar for the * key on phones and remote controls.

§

NumpadParenLeft

( Found on the Microsoft Natural Keyboard.

§

NumpadParenRight

) Found on the Microsoft Natural Keyboard.

§

NumpadStar

* on a phone or remote control device.

This key is typically found below the 7 key and to the left of the 0 key.

Use “NumpadMultiply” for the * key on numeric keypads.

§

NumpadSubtract

-

§

Escape

Esc or

§

Back

Some laptops place this key to the left of the key.

This also the “back” button (triangle) on Android.

§

F1

General-purpose function key. Usually found at the top of the keyboard.

§

F2

General-purpose function key. Usually found at the top of the keyboard.

§

F3

General-purpose function key. Usually found at the top of the keyboard.

§

F4

General-purpose function key. Usually found at the top of the keyboard.

§

F5

General-purpose function key. Usually found at the top of the keyboard.

§

F6

General-purpose function key. Usually found at the top of the keyboard.

§

F7

General-purpose function key. Usually found at the top of the keyboard.

§

F8

General-purpose function key. Usually found at the top of the keyboard.

§

F9

General-purpose function key. Usually found at the top of the keyboard.

§

F10

General-purpose function key. Usually found at the top of the keyboard.

§

F11

General-purpose function key. Usually found at the top of the keyboard.

§

F12

General-purpose function key. Usually found at the top of the keyboard.

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

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

impl<'de> Deserialize<'de> for Key

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Key

source§

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

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

impl FromStr for Key

§

type Err = ParseError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Key, <Self as FromStr>::Err>

Parses a string s to return a value of this type. Read more
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 PartialEq for Key

source§

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

impl Serialize for Key

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&str> for Key

§

type Error = ParseError

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

fn try_from(s: &str) -> Result<Key, <Self as TryFrom<&str>>::Error>

Performs the conversion.
source§

impl Copy for Key

source§

impl Eq for Key

source§

impl StructuralEq for Key

source§

impl StructuralPartialEq for Key

Auto Trait Implementations§

§

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
§

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

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> ToString for T
where T: Display + ?Sized,

source§

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

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,