Skip to main content

gled_model/input/
key_code.rs

1//! Keyboard keys as gled stores them in projects (tap, blackout and scene
2//! inputs). This mirrors egui's `Key` variant for variant and in the same
3//! order, so projects saved with `egui::Key` load unchanged and sets of input
4//! events keep their order, without the model depending on egui. The
5//! conversions live in `key_code_egui`.
6
7use serde::{Deserialize, Serialize};
8use strum::VariantArray;
9
10#[derive(
11    Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, VariantArray,
12)]
13pub enum KeyCode {
14    ArrowDown,
15    ArrowLeft,
16    ArrowRight,
17    ArrowUp,
18    Escape,
19    Tab,
20    Backspace,
21    Enter,
22    Space,
23    Insert,
24    Delete,
25    Home,
26    End,
27    PageUp,
28    PageDown,
29    Copy,
30    Cut,
31    Paste,
32    Colon,
33    Comma,
34    Backslash,
35    Slash,
36    Pipe,
37    Questionmark,
38    Exclamationmark,
39    OpenBracket,
40    CloseBracket,
41    OpenCurlyBracket,
42    CloseCurlyBracket,
43    Backtick,
44    Minus,
45    Period,
46    Plus,
47    Equals,
48    Semicolon,
49    Quote,
50    Num0,
51    Num1,
52    Num2,
53    Num3,
54    Num4,
55    Num5,
56    Num6,
57    Num7,
58    Num8,
59    Num9,
60    A,
61    B,
62    C,
63    D,
64    E,
65    F,
66    G,
67    H,
68    I,
69    J,
70    K,
71    L,
72    M,
73    N,
74    O,
75    P,
76    Q,
77    R,
78    S,
79    T,
80    U,
81    V,
82    W,
83    X,
84    Y,
85    Z,
86    F1,
87    F2,
88    F3,
89    F4,
90    F5,
91    F6,
92    F7,
93    F8,
94    F9,
95    F10,
96    F11,
97    F12,
98    F13,
99    F14,
100    F15,
101    F16,
102    F17,
103    F18,
104    F19,
105    F20,
106    F21,
107    F22,
108    F23,
109    F24,
110    F25,
111    F26,
112    F27,
113    F28,
114    F29,
115    F30,
116    F31,
117    F32,
118    F33,
119    F34,
120    F35,
121    BrowserBack,
122    ShiftLeft,
123    ShiftRight,
124    ControlLeft,
125    ControlRight,
126    AltLeft,
127    AltRight,
128    SuperLeft,
129    SuperRight,
130    IntlBackslash,
131}