#[repr(u8)]pub enum Key {
Show 64 variants
Escape = 0,
ArrowDown = 1,
ArrowLeft = 2,
ArrowRight = 3,
ArrowUp = 4,
End = 5,
Home = 6,
PageDown = 7,
PageUp = 8,
Enter = 9,
Tab = 10,
Backspace = 11,
Delete = 12,
Space = 13,
AltLeft = 14,
AltRight = 15,
ShiftLeft = 16,
ShiftRight = 17,
Digit0 = 18,
Digit1 = 19,
Digit2 = 20,
Digit3 = 21,
Digit4 = 22,
Digit5 = 23,
Digit6 = 24,
Digit7 = 25,
Digit8 = 26,
Digit9 = 27,
Numpad0 = 28,
Numpad1 = 29,
Numpad2 = 30,
Numpad3 = 31,
Numpad4 = 32,
Numpad5 = 33,
Numpad6 = 34,
Numpad7 = 35,
Numpad8 = 36,
Numpad9 = 37,
KeyA = 38,
KeyB = 39,
KeyC = 40,
KeyD = 41,
KeyE = 42,
KeyF = 43,
KeyG = 44,
KeyH = 45,
KeyI = 46,
KeyJ = 47,
KeyK = 48,
KeyL = 49,
KeyM = 50,
KeyN = 51,
KeyO = 52,
KeyP = 53,
KeyQ = 54,
KeyR = 55,
KeyS = 56,
KeyT = 57,
KeyU = 58,
KeyV = 59,
KeyW = 60,
KeyX = 61,
KeyY = 62,
KeyZ = 63,
}
Expand description
Rust representation of a set of common keys. The names match the Key Code Values. The keys listed should all have the same representation on all platforms.
For older browsers that don’t support the code
value, a conversion from the key
value is done with best effort. This may not consider keyboard layouts perfectly.
Variants§
Escape = 0
ArrowDown = 1
ArrowLeft = 2
ArrowRight = 3
ArrowUp = 4
End = 5
Home = 6
PageDown = 7
PageUp = 8
Enter = 9
Tab = 10
Backspace = 11
Delete = 12
Space = 13
AltLeft = 14
AltRight = 15
ShiftLeft = 16
ShiftRight = 17
Digit0 = 18
Digit1 = 19
Digit2 = 20
Digit3 = 21
Digit4 = 22
Digit5 = 23
Digit6 = 24
Digit7 = 25
Digit8 = 26
Digit9 = 27
Numpad0 = 28
Numpad1 = 29
Numpad2 = 30
Numpad3 = 31
Numpad4 = 32
Numpad5 = 33
Numpad6 = 34
Numpad7 = 35
Numpad8 = 36
Numpad9 = 37
KeyA = 38
KeyB = 39
KeyC = 40
KeyD = 41
KeyE = 42
KeyF = 43
KeyG = 44
KeyH = 45
KeyI = 46
KeyJ = 47
KeyK = 48
KeyL = 49
KeyM = 50
KeyN = 51
KeyO = 52
KeyP = 53
KeyQ = 54
KeyR = 55
KeyS = 56
KeyT = 57
KeyU = 58
KeyV = 59
KeyW = 60
KeyX = 61
KeyY = 62
KeyZ = 63
Trait Implementations§
Source§impl FromWasmAbi for Key
impl FromWasmAbi for Key
Source§impl IntoWasmAbi for Key
impl IntoWasmAbi for Key
Source§impl OptionFromWasmAbi for Key
impl OptionFromWasmAbi for Key
Source§impl OptionIntoWasmAbi for Key
impl OptionIntoWasmAbi for Key
Source§impl TryFromJsValue for Key
impl TryFromJsValue for Key
Source§impl VectorFromWasmAbi for Key
impl VectorFromWasmAbi for Key
Source§impl VectorIntoWasmAbi for Key
impl VectorIntoWasmAbi for Key
impl Copy for Key
impl Eq for Key
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.