TheAtlasEngine
 
Loading...
Searching...
No Matches
key_codes.hpp
1#pragma once
2#include <cstdint>
3
4namespace atlas::event {
5 enum Key : uint32_t {
6 // From glfw3.h
7 Space = 32,
8 Apostrophe = 39, /* ' */
9 Comma = 44, /* , */
10 Minus = 45, /* - */
11 Period = 46, /* . */
12 Slash = 47, /* / */
13
14 D0 = 48, /* 0 */
15 D1 = 49, /* 1 */
16 D2 = 50, /* 2 */
17 D3 = 51, /* 3 */
18 D4 = 52, /* 4 */
19 D5 = 53, /* 5 */
20 D6 = 54, /* 6 */
21 D7 = 55, /* 7 */
22 D8 = 56, /* 8 */
23 D9 = 57, /* 9 */
24
25 Semicolon = 59, /* ; */
26 Equal = 61, /* = */
27
28 A = 65,
29 B = 66,
30 C = 67,
31 D = 68,
32 E = 69,
33 F = 70,
34 G = 71,
35 H = 72,
36 I = 73,
37 J = 74,
38 K = 75,
39 L = 76,
40 M = 77,
41 N = 78,
42 O = 79,
43 P = 80,
44 Q = 81,
45 R = 82,
46 S = 83,
47 T = 84,
48 U = 85,
49 V = 86,
50 W = 87,
51 X = 88,
52 Y = 89,
53 Z = 90,
54
55 LeftBracket = 91, /* [ */
56 Backslash = 92, /* \ */
57 RightBracket = 93, /* ] */
58 GraveAccent = 96, /* ` */
59
60 World1 = 161, /* non-US #1 */
61 World2 = 162, /* non-US #2 */
62
63 /* Function keys */
64 Escape = 256,
65 Enter = 257,
66 Tab = 258,
67 Backspace = 259,
68 Insert = 260,
69 Delete = 261,
70 Right = 262,
71 Left = 263,
72 Down = 264,
73 Up = 265,
74 PageUp = 266,
75 PageDown = 267,
76 Home = 268,
77 End = 269,
78 CapsLock = 280,
79 ScrollLock = 281,
80 NumLock = 282,
81 PrintScreen = 283,
82 Pause = 284,
83 F1 = 290,
84 F2 = 291,
85 F3 = 292,
86 F4 = 293,
87 F5 = 294,
88 F6 = 295,
89 F7 = 296,
90 F8 = 297,
91 F9 = 298,
92 F10 = 299,
93 F11 = 300,
94 F12 = 301,
95 F13 = 302,
96 F14 = 303,
97 F15 = 304,
98 F16 = 305,
99 F17 = 306,
100 F18 = 307,
101 F19 = 308,
102 F20 = 309,
103 F21 = 310,
104 F22 = 311,
105 F23 = 312,
106 F24 = 313,
107 F25 = 314,
108
109 /* Keypad */
110 KP0 = 320,
111 KP1 = 321,
112 KP2 = 322,
113 KP3 = 323,
114 KP4 = 324,
115 KP5 = 325,
116 KP6 = 326,
117 KP7 = 327,
118 KP8 = 328,
119 KP9 = 329,
120 KPDecimal = 330,
121 KPDivide = 331,
122 KPMultiply = 332,
123 KPSubtract = 333,
124 KPAdd = 334,
125 KPEnter = 335,
126 KPEqual = 336,
127
128 LeftShift = 340,
129 LeftControl = 341,
130 LeftAlt = 342,
131 Leftsuper = 343,
132 RightShift = 344,
133 RightControl = 345,
134 RightAlt = 346,
135 Rightsuper = 347,
136 Menu = 348
137 };
138}
139
140// From glfw3.h
141
142inline constexpr uint32_t key_space = ::atlas::event::Key::Space;
143inline constexpr uint32_t key_apostrophe =
144 ::atlas::event::Key::Apostrophe; /* ' */
145inline constexpr uint32_t key_comma = ::atlas::event::Key::Comma; /* , */
146inline constexpr uint32_t key_minus = ::atlas::event::Key::Minus; /* - */
147inline constexpr uint32_t key_period = ::atlas::event::Key::Period; /* . */
148inline constexpr uint32_t key_slash = ::atlas::event::Key::Slash; /* / */
149inline constexpr uint32_t key_0 = ::atlas::event::Key::D0;
150inline constexpr uint32_t key_1 = ::atlas::event::Key::D1;
151inline constexpr uint32_t key_2 = ::atlas::event::Key::D2;
152inline constexpr uint32_t key_3 = ::atlas::event::Key::D3;
153inline constexpr uint32_t key_4 = ::atlas::event::Key::D4;
154inline constexpr uint32_t key_5 = ::atlas::event::Key::D5;
155inline constexpr uint32_t key_6 = ::atlas::event::Key::D6;
156inline constexpr uint32_t key_7 = ::atlas::event::Key::D7;
157inline constexpr uint32_t key_8 = ::atlas::event::Key::D8;
158inline constexpr uint32_t key_9 = ::atlas::event::Key::D9;
159inline constexpr uint32_t key_semicolon =
160 ::atlas::event::Key::Semicolon; /* ; */
161inline constexpr uint32_t key_equal = ::atlas::event::Key::Equal; /* = */
162inline constexpr uint32_t key_a = ::atlas::event::Key::A;
163inline constexpr uint32_t key_b = ::atlas::event::Key::B;
164inline constexpr uint32_t key_c = ::atlas::event::Key::C;
165inline constexpr uint32_t key_d = ::atlas::event::Key::D;
166inline constexpr uint32_t key_e = ::atlas::event::Key::E;
167inline constexpr uint32_t key_f = ::atlas::event::Key::F;
168inline constexpr uint32_t key_g = ::atlas::event::Key::G;
169inline constexpr uint32_t key_h = ::atlas::event::Key::H;
170inline constexpr uint32_t key_i = ::atlas::event::Key::I;
171inline constexpr uint32_t key_j = ::atlas::event::Key::J;
172inline constexpr uint32_t key_k = ::atlas::event::Key::K;
173inline constexpr uint32_t key_l = ::atlas::event::Key::L;
174inline constexpr uint32_t key_m = ::atlas::event::Key::M;
175inline constexpr uint32_t key_n = ::atlas::event::Key::N;
176inline constexpr uint32_t key_o = ::atlas::event::Key::O;
177inline constexpr uint32_t key_p = ::atlas::event::Key::P;
178inline constexpr uint32_t key_q = ::atlas::event::Key::Q;
179inline constexpr uint32_t key_r = ::atlas::event::Key::R;
180inline constexpr uint32_t key_s = ::atlas::event::Key::S;
181// inline constexpr uint32_t key_t = ::atlas::event::Key::T;
182inline constexpr uint32_t key_u = ::atlas::event::Key::U;
183inline constexpr uint32_t key_v = ::atlas::event::Key::V;
184inline constexpr uint32_t key_w = ::atlas::event::Key::W;
185inline constexpr uint32_t key_x = ::atlas::event::Key::X;
186inline constexpr uint32_t key_y = ::atlas::event::Key::Y;
187inline constexpr uint32_t key_z = ::atlas::event::Key::Z;
188inline constexpr uint32_t key_left_bracket =
189 ::atlas::event::Key::LeftBracket; /* [ */
190inline constexpr uint32_t key_backslash =
191 ::atlas::event::Key::Backslash; /* \ */
192inline constexpr uint32_t key_right_bracket =
193 ::atlas::event::Key::RightBracket; /* ] */
194inline constexpr uint32_t key_gravity_accent =
195 ::atlas::event::Key::GraveAccent; /* ` */
196inline constexpr uint32_t key_world_1 =
197 ::atlas::event::Key::World1; /* non-US #1 */
198inline constexpr uint32_t key_world_2 =
199 ::atlas::event::Key::World2; /* non-US #2 */
200
201/* Function keys */
202inline constexpr uint32_t key_escape = ::atlas::event::Key::Escape;
203inline constexpr uint32_t key_enter = ::atlas::event::Key::Enter;
204inline constexpr uint32_t key_tab = ::atlas::event::Key::Tab;
205inline constexpr uint32_t key_backspace = ::atlas::event::Key::Backspace;
206inline constexpr uint32_t key_insert = ::atlas::event::Key::Insert;
207inline constexpr uint32_t key_delete = ::atlas::event::Key::Delete;
208inline constexpr uint32_t key_right = ::atlas::event::Key::Right;
209inline constexpr uint32_t key_left = ::atlas::event::Key::Left;
210inline constexpr uint32_t key_down = ::atlas::event::Key::Down;
211inline constexpr uint32_t key_up = ::atlas::event::Key::Up;
212inline constexpr uint32_t key_page_up = ::atlas::event::Key::PageUp;
213inline constexpr uint32_t key_page_down = ::atlas::event::Key::PageDown;
214inline constexpr uint32_t key_home = ::atlas::event::Key::Home;
215inline constexpr uint32_t key_end = ::atlas::event::Key::End;
216inline constexpr uint32_t key_caps_lock = ::atlas::event::Key::CapsLock;
217inline constexpr uint32_t key_scroll_lock = ::atlas::event::Key::ScrollLock;
218inline constexpr uint32_t key_num_lock = ::atlas::event::Key::NumLock;
219inline constexpr uint32_t key_print_screen = ::atlas::event::Key::PrintScreen;
220inline constexpr uint32_t key_pause = ::atlas::event::Key::Pause;
221inline constexpr uint32_t key_f1 = ::atlas::event::Key::F1;
222inline constexpr uint32_t key_f2 = ::atlas::event::Key::F2;
223inline constexpr uint32_t key_f3 = ::atlas::event::Key::F3;
224inline constexpr uint32_t key_f4 = ::atlas::event::Key::F4;
225inline constexpr uint32_t key_f5 = ::atlas::event::Key::F5;
226inline constexpr uint32_t key_f6 = ::atlas::event::Key::F6;
227inline constexpr uint32_t key_f7 = ::atlas::event::Key::F7;
228inline constexpr uint32_t key_f8 = ::atlas::event::Key::F8;
229inline constexpr uint32_t key_f9 = ::atlas::event::Key::F9;
230inline constexpr uint32_t key_f10 = ::atlas::event::Key::F10;
231inline constexpr uint32_t key_f11 = ::atlas::event::Key::F11;
232inline constexpr uint32_t key_f12 = ::atlas::event::Key::F12;
233inline constexpr uint32_t key_f13 = ::atlas::event::Key::F13;
234inline constexpr uint32_t key_f14 = ::atlas::event::Key::F14;
235inline constexpr uint32_t key_f15 = ::atlas::event::Key::F15;
236inline constexpr uint32_t key_f16 = ::atlas::event::Key::F16;
237inline constexpr uint32_t key_f17 = ::atlas::event::Key::F17;
238inline constexpr uint32_t key_f18 = ::atlas::event::Key::F18;
239inline constexpr uint32_t key_f19 = ::atlas::event::Key::F19;
240inline constexpr uint32_t key_f20 = ::atlas::event::Key::F20;
241inline constexpr uint32_t key_f21 = ::atlas::event::Key::F21;
242inline constexpr uint32_t key_f22 = ::atlas::event::Key::F22;
243inline constexpr uint32_t key_f23 = ::atlas::event::Key::F23;
244inline constexpr uint32_t key_f24 = ::atlas::event::Key::F24;
245inline constexpr uint32_t key_f25 = ::atlas::event::Key::F25;
246
247/* Keypad */
248inline constexpr uint32_t key_kp_0 = ::atlas::event::Key::KP0;
249inline constexpr uint32_t key_kp_1 = ::atlas::event::Key::KP1;
250inline constexpr uint32_t key_kp_2 = ::atlas::event::Key::KP2;
251inline constexpr uint32_t key_kp_3 = ::atlas::event::Key::KP3;
252inline constexpr uint32_t key_kp_4 = ::atlas::event::Key::KP4;
253inline constexpr uint32_t key_kp_5 = ::atlas::event::Key::KP5;
254inline constexpr uint32_t key_kp_6 = ::atlas::event::Key::KP6;
255inline constexpr uint32_t key_kp_7 = ::atlas::event::Key::KP7;
256inline constexpr uint32_t key_kp_8 = ::atlas::event::Key::KP8;
257inline constexpr uint32_t key_kp_9 = ::atlas::event::Key::KP9;
258inline constexpr uint32_t key_kp_decimal = ::atlas::event::Key::KPDecimal;
259inline constexpr uint32_t key_kp_divide = ::atlas::event::Key::KPDivide;
260inline constexpr uint32_t key_kp_multiply = ::atlas::event::Key::KPMultiply;
261inline constexpr uint32_t key_kp_subtract = ::atlas::event::Key::KPSubtract;
262inline constexpr uint32_t key_kp_add = ::atlas::event::Key::KPAdd;
263inline constexpr uint32_t key_kp_enter = ::atlas::event::Key::KPEnter;
264inline constexpr uint32_t key_kp_equal = ::atlas::event::Key::KPEqual;
265
266inline constexpr uint32_t key_left_shift = ::atlas::event::Key::LeftShift;
267inline constexpr uint32_t key_left_control = ::atlas::event::Key::LeftControl;
268inline constexpr uint32_t key_left_alt = ::atlas::event::Key::LeftAlt;
269inline constexpr uint32_t key_left_super = ::atlas::event::Key::Leftsuper;
270inline constexpr uint32_t key_right_shift = ::atlas::event::Key::RightShift;
271inline constexpr uint32_t key_right_control = ::atlas::event::Key::RightControl;
272inline constexpr uint32_t key_right_alt = ::atlas::event::Key::RightAlt;
273inline constexpr uint32_t key_right_super = ::atlas::event::Key::Rightsuper;
274inline constexpr uint32_t key_menu = ::atlas::event::Key::Menu;