Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
Key.h
Go to the documentation of this file.
1/**
2 * @file Key.h
3 * @ingroup mnd_input
4 * @brief Strongly-typed key codes; values mirror GLFW.
5 *
6 * Underlying integer values are deliberately identical to `GLFW_KEY_*`
7 * and `GLFW_MOUSE_BUTTON_*` (USB HID usage codes for letters/digits) so
8 * an `mnd::Key` can be passed straight to GLFW callbacks without a
9 * translation table, while still giving the C++ side type safety.
10 *
11 * @code
12 * if (input.IsKeyDown(mnd::Key::W)) { ... }
13 * if (input.IsMouseButtonPressed(mnd::Key::MouseLeft)) { ... }
14 * @endcode
15 */
16
17#pragma once
18
19#include "Types.h"
20
21namespace mnd
22{
23
24/**
25 * @ingroup mnd_input
26 * @brief Keyboard key + mouse button identifier (GLFW-compatible values).
27 */
28enum class Key : i16
29{
30 Unknown = -1,
31
32 Space = 32,
33 Apostrophe = 39,
34 Comma = 44,
35 Minus = 45,
36 Period = 46,
37 Slash = 47,
38
39 Num0 = 48,
40 Num1 = 49,
41 Num2 = 50,
42 Num3 = 51,
43 Num4 = 52,
44 Num5 = 53,
45 Num6 = 54,
46 Num7 = 55,
47 Num8 = 56,
48 Num9 = 57,
49
50 Semicolon = 59,
51 Equal = 61,
52
53 A = 65,
54 B = 66,
55 C = 67,
56 D = 68,
57 E = 69,
58 F = 70,
59 G = 71,
60 H = 72,
61 I = 73,
62 J = 74,
63 K = 75,
64 L = 76,
65 M = 77,
66 N = 78,
67 O = 79,
68 P = 80,
69 Q = 81,
70 R = 82,
71 S = 83,
72 T = 84,
73 U = 85,
74 V = 86,
75 W = 87,
76 X = 88,
77 Y = 89,
78 Z = 90,
79
80 LeftBracket = 91,
81 Backslash = 92,
82 RightBracket = 93,
83 GraveAccent = 96,
84
85 Escape = 256,
86 Enter = 257,
87 Tab = 258,
88 Backspace = 259,
89 Insert = 260,
90 Delete = 261,
91 Right = 262,
92 Left = 263,
93 Down = 264,
94 Up = 265,
95 PageUp = 266,
96 PageDown = 267,
97 Home = 268,
98 End = 269,
99
100 CapsLock = 280,
101 ScrollLock = 281,
102 NumLock = 282,
103 PrintScreen = 283,
104 Pause = 284,
105
106 F1 = 290,
107 F2 = 291,
108 F3 = 292,
109 F4 = 293,
110 F5 = 294,
111 F6 = 295,
112 F7 = 296,
113 F8 = 297,
114 F9 = 298,
115 F10 = 299,
116 F11 = 300,
117 F12 = 301,
118
119 Kp0 = 320,
120 Kp1 = 321,
121 Kp2 = 322,
122 Kp3 = 323,
123 Kp4 = 324,
124 Kp5 = 325,
125 Kp6 = 326,
126 Kp7 = 327,
127 Kp8 = 328,
128 Kp9 = 329,
129 KpDecimal = 330,
130 KpDivide = 331,
131 KpMultiply = 332,
132 KpSubtract = 333,
133 KpAdd = 334,
134 KpEnter = 335,
135 KpEqual = 336,
136
137 LeftShift = 340,
138 LeftControl = 341,
139 LeftAlt = 342,
140 LeftSuper = 343,
141 RightShift = 344,
142 RightControl = 345,
143 RightAlt = 346,
144 RightSuper = 347,
145 Menu = 348,
146};
147
148enum class MouseButton : i8
149{
150 Left = 0,
151 Right = 1,
152 Middle = 2,
153 Btn4 = 3,
154 Btn5 = 4,
155 Btn6 = 5,
156 Btn7 = 6,
157 Btn8 = 7,
158};
159
160} // namespace mnd
Engine-wide primitive type aliases and GLM math imports.
int8_t i8
Signed 8-bit integer.
Definition Types.h:35
int16_t i16
Signed 16-bit integer.
Definition Types.h:36
Key
Keyboard key + mouse button identifier (GLFW-compatible values).
Definition Key.h:29
MouseButton
Definition Key.h:149