#[repr(u8)]
pub enum Keycode {
Show 100 variants OverflowError = 0, Escape = 1, Num1 = 2, Num2 = 3, Num3 = 4, Num4 = 5, Num5 = 6, Num6 = 7, Num7 = 8, Num8 = 9, Num9 = 10, Num0 = 11, Minus = 12, Equals = 13, Backspace = 14, Tab = 15, Q = 16, W = 17, E = 18, R = 19, T = 20, Y = 21, U = 22, I = 23, O = 24, P = 25, LeftBracket = 26, RightBracket = 27, Enter = 28, Control = 29, A = 30, S = 31, D = 32, F = 33, G = 34, H = 35, J = 36, K = 37, L = 38, Semicolon = 39, Quote = 40, Backtick = 41, LeftShift = 42, Backslash = 43, Z = 44, X = 45, C = 46, V = 47, B = 48, N = 49, M = 50, Comma = 51, Period = 52, Slash = 53, RightShift = 54, PadMultiply = 55, Alt = 56, Space = 57, CapsLock = 58, F1 = 59, F2 = 60, F3 = 61, F4 = 62, F5 = 63, F6 = 64, F7 = 65, F8 = 66, F9 = 67, F10 = 68, NumLock = 69, ScrollLock = 70, Home = 71, Up = 72, PageUp = 73, PadMinus = 74, Left = 75, Pad5 = 76, Right = 77, PadPlus = 78, End = 79, Down = 80, PageDown = 81, Insert = 82, Delete = 83, Unknown1 = 84, Unknown2 = 85, NonUsBackslash = 86, F11 = 87, F12 = 88, Pause = 89, Unknown3 = 90, SuperKeyLeft = 91, SuperKeyRight = 92, Menu = 93, ControlReleased = 157, AltReleased = 184, LeftShiftReleased = 170, RightShiftReleased = 182, SuperKeyLeftReleased = 219, SuperKeyRightReleased = 220,
}

Variants§

§

OverflowError = 0

§

Escape = 1

§

Num1 = 2

§

Num2 = 3

§

Num3 = 4

§

Num4 = 5

§

Num5 = 6

§

Num6 = 7

§

Num7 = 8

§

Num8 = 9

§

Num9 = 10

§

Num0 = 11

§

Minus = 12

§

Equals = 13

§

Backspace = 14

§

Tab = 15

§

Q = 16

§

W = 17

§

E = 18

§

R = 19

§

T = 20

§

Y = 21

§

U = 22

§

I = 23

§

O = 24

§

P = 25

§

LeftBracket = 26

§

RightBracket = 27

§

Enter = 28

§

Control = 29

§

A = 30

§

S = 31

§

D = 32

§

F = 33

§

G = 34

§

H = 35

§

J = 36

§

K = 37

§

L = 38

§

Semicolon = 39

§

Quote = 40

§

Backtick = 41

§

LeftShift = 42

§

Backslash = 43

§

Z = 44

§

X = 45

§

C = 46

§

V = 47

§

B = 48

§

N = 49

§

M = 50

§

Comma = 51

§

Period = 52

§

Slash = 53

§

RightShift = 54

§

PadMultiply = 55

§

Alt = 56

§

Space = 57

§

CapsLock = 58

§

F1 = 59

§

F2 = 60

§

F3 = 61

§

F4 = 62

§

F5 = 63

§

F6 = 64

§

F7 = 65

§

F8 = 66

§

F9 = 67

§

F10 = 68

§

NumLock = 69

§

ScrollLock = 70

§

Home = 71

§

Up = 72

§

PageUp = 73

§

PadMinus = 74

§

Left = 75

§

Pad5 = 76

§

Right = 77

§

PadPlus = 78

§

End = 79

§

Down = 80

§

PageDown = 81

§

Insert = 82

§

Delete = 83

§

Unknown1 = 84

§

Unknown2 = 85

§

NonUsBackslash = 86

§

F11 = 87

§

F12 = 88

§

Pause = 89

§

Unknown3 = 90

§

SuperKeyLeft = 91

§

SuperKeyRight = 92

§

Menu = 93

§

ControlReleased = 157

§

AltReleased = 184

§

LeftShiftReleased = 170

§

RightShiftReleased = 182

§

SuperKeyLeftReleased = 219

§

SuperKeyRightReleased = 220

Implementations§

source§

impl Keycode

source

pub fn to_ascii(&self, modifiers: KeyboardModifiers) -> Option<char>

Obtains the ascii value for a keycode under the given modifiers

source

pub fn is_letter(&self) -> bool

returns true if this keycode was a letter from A-Z

Trait Implementations§

source§

impl Clone for Keycode

source§

fn clone(&self) -> Keycode

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 Keycode

source§

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

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

impl PartialEq<Keycode> for Keycode

source§

fn eq(&self, other: &Keycode) -> 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 TryFrom<u8> for Keycode

§

type Error = TryFromPrimitiveError<Keycode>

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

fn try_from(number: u8) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
source§

impl TryFromPrimitive for Keycode

§

type Primitive = u8

source§

const NAME: &'static str = _

source§

fn try_from_primitive( number: Self::Primitive ) -> Result<Self, TryFromPrimitiveError<Self>>

source§

impl Copy for Keycode

source§

impl StructuralPartialEq for Keycode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere 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 Twhere 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.