iced-yoda/core/src/keyboard/key_code.rs

200 lines
2.7 KiB
Rust
Raw Normal View History

2019-08-31 06:20:56 +02:00
/// The symbolic name of a keyboard key.
///
2019-09-05 09:59:38 +02:00
/// This is mostly the `KeyCode` type found in [`winit`].
///
/// [`winit`]: https://docs.rs/winit/0.20.0-alpha3/winit/
2019-07-20 19:12:31 +02:00
#[derive(Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy)]
#[repr(u32)]
2019-08-31 06:20:56 +02:00
#[allow(missing_docs)]
2019-07-20 19:12:31 +02:00
pub enum KeyCode {
/// The '1' key over the letters.
Key1,
/// The '2' key over the letters.
Key2,
/// The '3' key over the letters.
Key3,
/// The '4' key over the letters.
Key4,
/// The '5' key over the letters.
Key5,
/// The '6' key over the letters.
Key6,
/// The '7' key over the letters.
Key7,
/// The '8' key over the letters.
Key8,
/// The '9' key over the letters.
Key9,
/// The '0' key over the 'O' and 'P' keys.
Key0,
2020-09-27 13:05:20 -07:00
Plus,
Asterisk,
2019-07-20 19:12:31 +02:00
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,
2019-08-31 06:20:56 +02:00
/// The Escape key, next to F1
2019-07-20 19:12:31 +02:00
Escape,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
F21,
F22,
F23,
F24,
2019-08-31 06:20:56 +02:00
/// Print Screen/SysRq
2019-07-20 19:12:31 +02:00
Snapshot,
2019-08-31 06:20:56 +02:00
/// Scroll Lock
2019-07-20 19:12:31 +02:00
Scroll,
2019-08-31 06:20:56 +02:00
/// Pause/Break key, next to Scroll lock
2019-07-20 19:12:31 +02:00
Pause,
2019-08-31 06:20:56 +02:00
/// `Insert`, next to Backspace
2019-07-20 19:12:31 +02:00
Insert,
Home,
Delete,
End,
PageDown,
PageUp,
Left,
Up,
Right,
Down,
2019-08-31 06:20:56 +02:00
Backspace,
Enter,
2019-07-20 19:12:31 +02:00
Space,
2019-08-31 06:20:56 +02:00
/// The "Compose" key on Linux
2019-07-20 19:12:31 +02:00
Compose,
Caret,
Numlock,
Numpad0,
Numpad1,
Numpad2,
Numpad3,
Numpad4,
Numpad5,
Numpad6,
Numpad7,
Numpad8,
Numpad9,
AbntC1,
AbntC2,
Add,
Apostrophe,
Apps,
At,
Ax,
Backslash,
Calculator,
Capital,
Colon,
Comma,
Convert,
Decimal,
Divide,
Equals,
Grave,
Kana,
Kanji,
LAlt,
LBracket,
LControl,
LShift,
LWin,
Mail,
MediaSelect,
MediaStop,
Minus,
Multiply,
Mute,
MyComputer,
NavigateForward, // also called "Prior"
NavigateBackward, // also called "Next"
NextTrack,
NoConvert,
NumpadComma,
NumpadEnter,
NumpadEquals,
OEM102,
Period,
PlayPause,
Power,
PrevTrack,
RAlt,
RBracket,
RControl,
RShift,
RWin,
Semicolon,
Slash,
Sleep,
Stop,
Subtract,
Sysrq,
Tab,
Underline,
Unlabeled,
VolumeDown,
VolumeUp,
Wake,
WebBack,
WebFavorites,
WebForward,
WebHome,
WebRefresh,
WebSearch,
WebStop,
Yen,
Copy,
Paste,
Cut,
}