termfest/
key.rs

1//! This module defines a variant of special keys and their aliases.
2
3#[derive(Debug, Clone, Copy, FromPrimitive, PartialEq, Eq, PartialOrd, Ord, Hash)]
4pub enum Key {
5    CtrlA = 0x01,
6    CtrlB = 0x02,
7    CtrlC = 0x03,
8    CtrlD = 0x04,
9    CtrlE = 0x05,
10    CtrlF = 0x06,
11    CtrlG = 0x07,
12    CtrlH = 0x08,
13    CtrlI = 0x09,
14    CtrlJ = 0x0a,
15    CtrlK = 0x0b,
16    CtrlL = 0x0c,
17    CtrlM = 0x0d,
18    CtrlN = 0x0e,
19    CtrlO = 0x0f,
20    CtrlP = 0x10,
21    CtrlQ = 0x11,
22    CtrlR = 0x12,
23    CtrlS = 0x13,
24    CtrlT = 0x14,
25    CtrlU = 0x15,
26    CtrlV = 0x16,
27    CtrlW = 0x17,
28    CtrlX = 0x18,
29    CtrlY = 0x19,
30    CtrlZ = 0x1a,
31    ESC = 0x1b,
32    Space = 0x20,
33    Backspace = 0x7f,
34    ArrowUp,
35    ArrowDown,
36    ArrowLeft,
37    ArrowRight,
38}
39
40pub use Key::*;
41
42/// An alias of `Key::CtrlM`
43pub const ENTER: Key = Key::CtrlM;