Optibits
Loading...
Searching...
No Matches
Keyboard.hpp
1#pragma once
2
3
4namespace Optibits
5{
6 enum Key
7 {
8 // @amine : See SDL_Scancode -> https://wiki.libsdl.org/SDL2/SDL_Scancode
9 KEY_ESCAPE = 41,
10 KEY_F1 = 58,
11 KEY_F2 = 59,
12 KEY_F3 = 60,
13 KEY_F4 = 61,
14 KEY_F5 = 62,
15 KEY_F6 = 63,
16 KEY_F7 = 64,
17 KEY_F8 = 65,
18 KEY_F9 = 66,
19 KEY_F10 = 67,
20 KEY_F11 = 68,
21 KEY_F12 = 69,
22 KEY_0 = 39,
23 KEY_1 = 30,
24 KEY_2 = 31,
25 KEY_3 = 32,
26 KEY_4 = 33,
27 KEY_5 = 34,
28 KEY_6 = 35,
29 KEY_7 = 36,
30 KEY_8 = 37,
31 KEY_9 = 38,
32 KEY_TAB = 43,
33 KEY_RETURN = 40,
34 KEY_SPACE = 44,
35 KEY_LEFT_SHIFT = 225,
36 KEY_RIGHT_SHIFT = 229,
37 KEY_LEFT_CONTROL = 224,
38 KEY_RIGHT_CONTROL = 228,
39 KEY_LEFT_ALT = 226,
40 KEY_RIGHT_ALT = 230,
41 KEY_LEFT_META = 227,
42 KEY_RIGHT_META = 231,
43 KEY_BACKSPACE = 42,
44 KEY_LEFT = 80,
45 KEY_RIGHT = 79,
46 KEY_UP = 82,
47 KEY_DOWN = 81,
48 KEY_HOME = 74,
49 KEY_END = 77,
50 KEY_PRINT_SCREEN = 70,
51 KEY_SCROLL_LOCK = 71,
52 KEY_PAUSE = 72,
53 KEY_INSERT = 73,
54 KEY_DELETE = 76,
55 KEY_PAGE_UP = 75,
56 KEY_PAGE_DOWN = 78,
57 KEY_ENTER = 88,
58 KEY_BACKTICK = 53,
59 KEY_MINUS = 45,
60 KEY_EQUALS = 46,
61 KEY_LEFT_BRACKET = 47,
62 KEY_RIGHT_BRACKET = 48,
63 KEY_BACKSLASH = 49,
64 KEY_SEMICOLON = 51,
65 KEY_APOSTROPHE = 52,
66 KEY_COMMA = 54,
67 KEY_PERIOD = 55,
68 KEY_SLASH = 56,
69 KEY_CAPS_LOCK = 57,
70 KEY_A = 4,
71 KEY_B = 5,
72 KEY_C = 6,
73 KEY_D = 7,
74 KEY_E = 8,
75 KEY_F = 9,
76 KEY_G = 10,
77 KEY_H = 11,
78 KEY_I = 12,
79 KEY_J = 13,
80 KEY_K = 14,
81 KEY_L = 15,
82 KEY_M = 16,
83 KEY_N = 17,
84 KEY_O = 18,
85 KEY_P = 19,
86 KEY_Q = 20,
87 KEY_R = 21,
88 KEY_S = 22,
89 KEY_T = 23,
90 KEY_U = 24,
91 KEY_V = 25,
92 KEY_W = 26,
93 KEY_X = 27,
94 KEY_Y = 28,
95 KEY_Z = 29,
96
98 KEY_ISO = 100,
99 KEY_NUMPAD_0 = 98,
100 KEY_NUMPAD_1 = 89,
101 KEY_NUMPAD_2 = 90,
102 KEY_NUMPAD_3 = 91,
103 KEY_NUMPAD_4 = 92,
104 KEY_NUMPAD_5 = 93,
105 KEY_NUMPAD_6 = 94,
106 KEY_NUMPAD_7 = 95,
107 KEY_NUMPAD_8 = 96,
108 KEY_NUMPAD_9 = 97,
109 KEY_NUMPAD_DELETE = 99,
110 KEY_NUMPAD_PLUS = 87,
111 KEY_NUMPAD_MINUS = 86,
112 KEY_NUMPAD_MULTIPLY = 85,
113 KEY_NUMPAD_DIVIDE = 84,
114 KEY_RANGE_END = 0xff,
115
116 MS_RANGE_BEGIN,
117 MS_LEFT = MS_RANGE_BEGIN,
118 MS_MIDDLE,
119 MS_RIGHT,
120 MS_WHEEL_UP,
121 MS_WHEEL_DOWN,
122 MS_OTHER_0,
123 MS_OTHER_1,
124 MS_OTHER_2,
125 MS_OTHER_3,
126 MS_OTHER_4,
127 MS_OTHER_5,
128 MS_OTHER_6,
129 MS_OTHER_7,
130
131 GP_RANGE_BEGIN,
132 GP_DPAD_LEFT = GP_RANGE_BEGIN,
133 GP_DPAD_RIGHT,
134 GP_DPAD_UP,
135 GP_DPAD_DOWN,
136 GP_BUTTON_0,
137 GP_BUTTON_1,
138 GP_BUTTON_2,
139 GP_BUTTON_3,
140 GP_BUTTON_4,
141 GP_BUTTON_5,
142 GP_BUTTON_6,
143 GP_BUTTON_7,
144 GP_BUTTON_8,
145 GP_BUTTON_9,
146 GP_BUTTON_10,
147 GP_BUTTON_11,
148 GP_BUTTON_12,
149 GP_BUTTON_13,
150 GP_BUTTON_14,
151 GP_BUTTON_15,
152
153 GP_0_DPAD_LEFT,
154 GP_0_DPAD_RIGHT,
155 GP_0_DPAD_UP,
156 GP_0_DPAD_DOWN,
157 GP_0_BUTTON_0,
158 GP_0_BUTTON_1,
159 GP_0_BUTTON_2,
160 GP_0_BUTTON_3,
161 GP_0_BUTTON_4,
162 GP_0_BUTTON_5,
163 GP_0_BUTTON_6,
164 GP_0_BUTTON_7,
165 GP_0_BUTTON_8,
166 GP_0_BUTTON_9,
167 GP_0_BUTTON_10,
168 GP_0_BUTTON_11,
169 GP_0_BUTTON_12,
170 GP_0_BUTTON_13,
171 GP_0_BUTTON_14,
172 GP_0_BUTTON_15,
173
174 GP_1_DPAD_LEFT,
175 GP_1_DPAD_RIGHT,
176 GP_1_DPAD_UP,
177 GP_1_DPAD_DOWN,
178 GP_1_BUTTON_0,
179 GP_1_BUTTON_1,
180 GP_1_BUTTON_2,
181 GP_1_BUTTON_3,
182 GP_1_BUTTON_4,
183 GP_1_BUTTON_5,
184 GP_1_BUTTON_6,
185 GP_1_BUTTON_7,
186 GP_1_BUTTON_8,
187 GP_1_BUTTON_9,
188 GP_1_BUTTON_10,
189 GP_1_BUTTON_11,
190 GP_1_BUTTON_12,
191 GP_1_BUTTON_13,
192 GP_1_BUTTON_14,
193 GP_1_BUTTON_15,
194
195 GP_2_DPAD_LEFT,
196 GP_2_DPAD_RIGHT,
197 GP_2_DPAD_UP,
198 GP_2_DPAD_DOWN,
199 GP_2_BUTTON_0,
200 GP_2_BUTTON_1,
201 GP_2_BUTTON_2,
202 GP_2_BUTTON_3,
203 GP_2_BUTTON_4,
204 GP_2_BUTTON_5,
205 GP_2_BUTTON_6,
206 GP_2_BUTTON_7,
207 GP_2_BUTTON_8,
208 GP_2_BUTTON_9,
209 GP_2_BUTTON_10,
210 GP_2_BUTTON_11,
211 GP_2_BUTTON_12,
212 GP_2_BUTTON_13,
213 GP_2_BUTTON_14,
214 GP_2_BUTTON_15,
215
216 GP_3_DPAD_LEFT,
217 GP_3_DPAD_RIGHT,
218 GP_3_DPAD_UP,
219 GP_3_DPAD_DOWN,
220 GP_3_BUTTON_0,
221 GP_3_BUTTON_1,
222 GP_3_BUTTON_2,
223 GP_3_BUTTON_3,
224 GP_3_BUTTON_4,
225 GP_3_BUTTON_5,
226 GP_3_BUTTON_6,
227 GP_3_BUTTON_7,
228 GP_3_BUTTON_8,
229 GP_3_BUTTON_9,
230 GP_3_BUTTON_10,
231 GP_3_BUTTON_11,
232 GP_3_BUTTON_12,
233 GP_3_BUTTON_13,
234 GP_3_BUTTON_14,
235 GP_3_BUTTON_15,
236
237 GP_LEFT,
238 GP_RIGHT,
239 GP_UP,
240 GP_DOWN,
241
242 GP_0_LEFT,
243 GP_0_RIGHT,
244 GP_0_UP,
245 GP_0_DOWN,
246
247 GP_1_LEFT,
248 GP_1_RIGHT,
249 GP_1_UP,
250 GP_1_DOWN,
251
252 GP_2_LEFT,
253 GP_2_RIGHT,
254 GP_2_UP,
255 GP_2_DOWN,
256
257 GP_3_LEFT,
258 GP_3_RIGHT,
259 GP_3_UP,
260 GP_3_DOWN,
261 GP_RANGE_END = GP_3_DOWN,
262
263 NUM_GAMEPADS = 4,
264 NO_BUTTON = 0xffffffff
265 };
266
267 enum Axis
268 {
269 GP_LEFT_STICK_X_AXIS,
270 GP_LEFT_STICK_Y_AXIS,
271 GP_RIGHT_STICK_X_AXIS,
272 GP_RIGHT_STICK_Y_AXIS,
273 GP_LEFT_TRIGGER_AXIS,
274 GP_RIGHT_TRIGGER_AXIS,
275
276 GP_0_LEFT_STICK_X_AXIS,
277 GP_0_LEFT_STICK_Y_AXIS,
278 GP_0_RIGHT_STICK_X_AXIS,
279 GP_0_RIGHT_STICK_Y_AXIS,
280 GP_0_LEFT_TRIGGER_AXIS,
281 GP_0_RIGHT_TRIGGER_AXIS,
282
283 GP_1_LEFT_STICK_X_AXIS,
284 GP_1_LEFT_STICK_Y_AXIS,
285 GP_1_RIGHT_STICK_X_AXIS,
286 GP_1_RIGHT_STICK_Y_AXIS,
287 GP_1_LEFT_TRIGGER_AXIS,
288 GP_1_RIGHT_TRIGGER_AXIS,
289
290 GP_2_LEFT_STICK_X_AXIS,
291 GP_2_LEFT_STICK_Y_AXIS,
292 GP_2_RIGHT_STICK_X_AXIS,
293 GP_2_RIGHT_STICK_Y_AXIS,
294 GP_2_LEFT_TRIGGER_AXIS,
295 GP_2_RIGHT_TRIGGER_AXIS,
296
297 GP_3_LEFT_STICK_X_AXIS,
298 GP_3_LEFT_STICK_Y_AXIS,
299 GP_3_RIGHT_STICK_X_AXIS,
300 GP_3_RIGHT_STICK_Y_AXIS,
301 GP_3_LEFT_TRIGGER_AXIS,
302 GP_3_RIGHT_TRIGGER_AXIS,
303
304 NUM_AXES
305 };
306}