cmdfx
0.2.1
Lightweight game engine for your terminal
Loading...
Searching...
No Matches
include
cmdfx
ui
keys.h
Go to the documentation of this file.
1
11
#pragma once
12
13
#ifdef __cplusplus
14
extern
"C"
{
15
#endif
16
17
#if defined(_WINDOWS) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
18
#define KEY_A 0x41
19
#define KEY_B 0x42
20
#define KEY_C 0x43
21
#define KEY_D 0x44
22
#define KEY_E 0x45
23
#define KEY_F 0x46
24
#define KEY_G 0x47
25
#define KEY_H 0x48
26
#define KEY_I 0x49
27
#define KEY_J 0x4A
28
#define KEY_K 0x4B
29
#define KEY_L 0x4C
30
#define KEY_M 0x4D
31
#define KEY_N 0x4E
32
#define KEY_O 0x4F
33
#define KEY_P 0x50
34
#define KEY_Q 0x51
35
#define KEY_R 0x52
36
#define KEY_S 0x53
37
#define KEY_T 0x54
38
#define KEY_U 0x55
39
#define KEY_V 0x56
40
#define KEY_W 0x57
41
#define KEY_X 0x58
42
#define KEY_Y 0x59
43
#define KEY_Z 0x5A
44
#define KEY_0 0x30
45
#define KEY_1 0x31
46
#define KEY_2 0x32
47
#define KEY_3 0x33
48
#define KEY_4 0x34
49
#define KEY_5 0x35
50
#define KEY_6 0x36
51
#define KEY_7 0x37
52
#define KEY_8 0x38
53
#define KEY_9 0x39
54
#define KEY_ENTER 0x0D
55
#define KEY_ESCAPE 0x1B
56
#define KEY_BACKSPACE 0x08
57
#define KEY_TAB 0x09
58
#define KEY_SPACE 0x20
59
#define KEY_MINUS 0x6D
60
#define KEY_EQUAL 0x6B
61
#define KEY_LEFT_BRACKET 0xDB
62
#define KEY_RIGHT_BRACKET 0xDD
63
#define KEY_BACKSLASH 0xDC
64
#define KEY_SEMICOLON 0xBA
65
#define KEY_APOSTROPHE 0xDE
66
#define KEY_COMMA 0xBC
67
#define KEY_PERIOD 0xBE
68
#define KEY_SLASH 0xBF
69
#define KEY_CAPS_LOCK 0x14
70
#define KEY_F1 0x70
71
#define KEY_F2 0x71
72
#define KEY_F3 0x72
73
#define KEY_F4 0x73
74
#define KEY_F5 0x74
75
#define KEY_F6 0x75
76
#define KEY_F7 0x76
77
#define KEY_F8 0x77
78
#define KEY_F9 0x78
79
#define KEY_F10 0x79
80
#define KEY_F11 0x7A
81
#define KEY_F12 0x7B
82
#define KEY_PRINT_SCREEN 0x2C
83
#define KEY_SCROLL_LOCK 0x91
84
#define KEY_PAUSE 0x13
85
#define KEY_INSERT 0x2D
86
#define KEY_HOME 0x24
87
#define KEY_PAGE_UP 0x21
88
#define KEY_DELETE 0x2E
89
#define KEY_END 0x23
90
#define KEY_PAGE_DOWN 0x22
91
#define KEY_RIGHT 0x27
92
#define KEY_LEFT 0x25
93
#define KEY_DOWN 0x28
94
#define KEY_UP 0x26
95
#define KEY_NUMLOCK 0x90
96
#define KEY_KP0 0x60
97
#define KEY_KP1 0x61
98
#define KEY_KP2 0x62
99
#define KEY_KP3 0x63
100
#define KEY_KP4 0x64
101
#define KEY_KP5 0x65
102
#define KEY_KP6 0x66
103
#define KEY_KP7 0x67
104
#define KEY_KP8 0x68
105
#define KEY_KP9 0x69
106
#define KEY_KPASTERISK 0x6A
107
#define KEY_KPPLUS 0x6B
108
#define KEY_KPMINUS 0x6D
109
#define KEY_KPDOT 0x6E
110
#define KEY_KPSLASH 0x6F
111
#define KEY_F13 0x7C
112
#define KEY_F14 0x7D
113
#define KEY_F15 0x7E
114
#define KEY_F16 0x7F
115
#define KEY_F17 0x80
116
#define KEY_F18 0x81
117
#define KEY_F19 0x82
118
#define KEY_F20 0x83
119
#define KEY_F21 0x84
120
#define KEY_F22 0x85
121
#define KEY_F23 0x86
122
#define KEY_F24 0x87
123
#define KEY_TILE 0xC0
124
#define KEY_SHIFT 0x10
125
#define KEY_CONTROL 0x11
126
#define KEY_ALT 0x12
127
#define KEY_LEFT_ALT 0xA4
128
#define KEY_LEFT_CONTROL 0xA2
129
#define KEY_LEFT_SHIFT 0xA0
130
#define KEY_RIGHT_ALT 0xA5
131
#define KEY_RIGHT_CONTROL 0xA3
132
#define KEY_RIGHT_SHIFT 0xA1
133
#define KEY_LEFT_WINDOWS 0x5B
134
#define KEY_RIGHT_WINDOWS 0x5C
135
#elif defined(__linux__)
136
#include <linux/input-event-codes.h>
// has definitions for KEY_* macros
137
#define KEY_LEFT_ARROW KEY_LEFT
138
#define KEY_RIGHT_ARROW KEY_RIGHT
139
#define KEY_UP_ARROW KEY_UP
140
#define KEY_DOWN_ARROW KEY_DOWN
141
#elif defined(__APPLE__)
142
#define KEY_A 0x00
143
#define KEY_S 0x01
144
#define KEY_D 0x02
145
#define KEY_F 0x03
146
#define KEY_H 0x04
147
#define KEY_G 0x05
148
#define KEY_Z 0x06
149
#define KEY_X 0x07
150
#define KEY_C 0x08
151
#define KEY_V 0x09
152
#define KEY_B 0x0B
153
#define KEY_Q 0x0C
154
#define KEY_W 0x0D
155
#define KEY_E 0x0E
156
#define KEY_R 0x0F
157
#define KEY_Y 0x10
158
#define KEY_T 0x11
159
#define KEY_1 0x12
160
#define KEY_2 0x13
161
#define KEY_3 0x14
162
#define KEY_4 0x15
163
#define KEY_6 0x16
164
#define KEY_5 0x17
165
#define KEY_EQUAL 0x18
166
#define KEY_9 0x19
167
#define KEY_7 0x1A
168
#define KEY_MINUS 0x1B
169
#define KEY_8 0x1C
170
#define KEY_0 0x1D
171
#define KEY_RIGHT_BRACKET 0x1E
172
#define KEY_O 0x1F
173
#define KEY_U 0x20
174
#define KEY_LEFT_BRACKET 0x21
175
#define KEY_I 0x22
176
#define KEY_P 0x23
177
#define KEY_RETURN 0x24
178
#define KEY_L 0x25
179
#define KEY_J 0x26
180
#define KEY_APOSTROPHE 0x27
181
#define KEY_K 0x28
182
#define KEY_SEMICOLON 0x29
183
#define KEY_BACKSLASH 0x2A
184
#define KEY_COMMA 0x2B
185
#define KEY_SLASH 0x2C
186
#define KEY_N 0x2D
187
#define KEY_M 0x2E
188
#define KEY_PERIOD 0x2F
189
#define KEY_TAB 0x30
190
#define KEY_SPACE 0x31
191
#define KEY_TILDE 0x32
192
#define KEY_DELETE 0x33
193
#define KEY_ESCAPE 0x35
194
#define KEY_RIGHT_COMMAND 0x36
195
#define KEY_COMMAND 0x37
196
#define KEY_SHIFT 0x38
197
#define KEY_CAPSLOCK 0x39
198
#define KEY_OPTION 0x3A
199
#define KEY_CONTROL 0x3B
200
#define KEY_RIGHT_SHIFT 0x3C
201
#define KEY_RIGHT_OPTION 0x3D
202
#define KEY_RIGHT_CONTROL 0x3E
203
#define KEY_FUNCTION 0x3F
204
#define KEY_F17 0x40
205
#define KEY_KPASTERISK 0x43
206
#define KEY_VOLUMEUP 0x48
207
#define KEY_VOLUMEDOWN 0x49
208
#define KEY_MUTE 0x4A
209
#define KEY_F18 0x4F
210
#define KEY_F19 0x50
211
#define KEY_KPEQUAL 0x51
212
#define KEY_KP0 0x52
213
#define KEY_KP1 0x53
214
#define KEY_KP2 0x54
215
#define KEY_KP3 0x55
216
#define KEY_KP4 0x56
217
#define KEY_KP5 0x57
218
#define KEY_KP6 0x58
219
#define KEY_KP7 0x59
220
#define KEY_F20 0x5A
221
#define KEY_KP8 0x5B
222
#define KEY_KP9 0x5C
223
#define KEY_F5 0x60
224
#define KEY_F6 0x61
225
#define KEY_F7 0x62
226
#define KEY_F3 0x63
227
#define KEY_F8 0x64
228
#define KEY_F9 0x65
229
#define KEY_F11 0x67
230
#define KEY_F13 0x69
231
#define KEY_F16 0x6A
232
#define KEY_F14 0x6B
233
#define KEY_F10 0x6D
234
#define KEY_F12 0x6F
235
#define KEY_F15 0x71
236
#define KEY_HELP 0x72
237
#define KEY_HOME 0x73
238
#define KEY_F4 0x76
239
#define KEY_F2 0x78
240
#define KEY_F1 0x7A
241
#define KEY_LEFT_ARROW 0x7B
242
#define KEY_RIGHT_ARROW 0x7C
243
#define KEY_DOWN_ARROW 0x7D
244
#define KEY_UP_ARROW 0x7E
245
#endif
246
#ifdef __cplusplus
247
}
248
#endif
Generated by
1.13.2