13#define KINC_KEY_UNKNOWN 0
14#define KINC_KEY_BACK 1
15#define KINC_KEY_CANCEL 3
16#define KINC_KEY_HELP 6
17#define KINC_KEY_BACKSPACE 8
19#define KINC_KEY_CLEAR 12
20#define KINC_KEY_RETURN 13
21#define KINC_KEY_SHIFT 16
22#define KINC_KEY_CONTROL 17
23#define KINC_KEY_ALT 18
24#define KINC_KEY_PAUSE 19
25#define KINC_KEY_CAPS_LOCK 20
26#define KINC_KEY_KANA 21
27#define KINC_KEY_HANGUL 21
28#define KINC_KEY_EISU 22
29#define KINC_KEY_JUNJA 23
30#define KINC_KEY_FINAL 24
31#define KINC_KEY_HANJA 25
32#define KINC_KEY_KANJI 25
33#define KINC_KEY_ESCAPE 27
34#define KINC_KEY_CONVERT 28
35#define KINC_KEY_NON_CONVERT 29
36#define KINC_KEY_ACCEPT 30
37#define KINC_KEY_MODE_CHANGE 31
38#define KINC_KEY_SPACE 32
39#define KINC_KEY_PAGE_UP 33
40#define KINC_KEY_PAGE_DOWN 34
41#define KINC_KEY_END 35
42#define KINC_KEY_HOME 36
43#define KINC_KEY_LEFT 37
45#define KINC_KEY_RIGHT 39
46#define KINC_KEY_DOWN 40
47#define KINC_KEY_SELECT 41
48#define KINC_KEY_PRINT 42
49#define KINC_KEY_EXECUTE 43
50#define KINC_KEY_PRINT_SCREEN 44
51#define KINC_KEY_INSERT 45
52#define KINC_KEY_DELETE 46
63#define KINC_KEY_COLON 58
64#define KINC_KEY_SEMICOLON 59
65#define KINC_KEY_LESS_THAN 60
66#define KINC_KEY_EQUALS 61
67#define KINC_KEY_GREATER_THAN 62
68#define KINC_KEY_QUESTIONMARK 63
96#define KINC_KEY_WIN 91
97#define KINC_KEY_CONTEXT_MENU 93
98#define KINC_KEY_SLEEP 95
99#define KINC_KEY_NUMPAD_0 96
100#define KINC_KEY_NUMPAD_1 97
101#define KINC_KEY_NUMPAD_2 98
102#define KINC_KEY_NUMPAD_3 99
103#define KINC_KEY_NUMPAD_4 100
104#define KINC_KEY_NUMPAD_5 101
105#define KINC_KEY_NUMPAD_6 102
106#define KINC_KEY_NUMPAD_7 103
107#define KINC_KEY_NUMPAD_8 104
108#define KINC_KEY_NUMPAD_9 105
109#define KINC_KEY_MULTIPLY 106
110#define KINC_KEY_ADD 107
111#define KINC_KEY_SEPARATOR 108
112#define KINC_KEY_SUBTRACT 109
113#define KINC_KEY_DECIMAL 110
114#define KINC_KEY_DIVIDE 111
115#define KINC_KEY_F1 112
116#define KINC_KEY_F2 113
117#define KINC_KEY_F3 114
118#define KINC_KEY_F4 115
119#define KINC_KEY_F5 116
120#define KINC_KEY_F6 117
121#define KINC_KEY_F7 118
122#define KINC_KEY_F8 119
123#define KINC_KEY_F9 120
124#define KINC_KEY_F10 121
125#define KINC_KEY_F11 122
126#define KINC_KEY_F12 123
127#define KINC_KEY_F13 124
128#define KINC_KEY_F14 125
129#define KINC_KEY_F15 126
130#define KINC_KEY_F16 127
131#define KINC_KEY_F17 128
132#define KINC_KEY_F18 129
133#define KINC_KEY_F19 130
134#define KINC_KEY_F20 131
135#define KINC_KEY_F21 132
136#define KINC_KEY_F22 133
137#define KINC_KEY_F23 134
138#define KINC_KEY_F24 135
139#define KINC_KEY_NUM_LOCK 144
140#define KINC_KEY_SCROLL_LOCK 145
141#define KINC_KEY_WIN_OEM_FJ_JISHO 146
142#define KINC_KEY_WIN_OEM_FJ_MASSHOU 147
143#define KINC_KEY_WIN_OEM_FJ_TOUROKU 148
144#define KINC_KEY_WIN_OEM_FJ_LOYA 149
145#define KINC_KEY_WIN_OEM_FJ_ROYA 150
146#define KINC_KEY_CIRCUMFLEX 160
147#define KINC_KEY_EXCLAMATION 161
148#define KINC_KEY_DOUBLE_QUOTE 162
149#define KINC_KEY_HASH 163
150#define KINC_KEY_DOLLAR 164
151#define KINC_KEY_PERCENT 165
152#define KINC_KEY_AMPERSAND 166
153#define KINC_KEY_UNDERSCORE 167
154#define KINC_KEY_OPEN_PAREN 168
155#define KINC_KEY_CLOSE_PAREN 169
156#define KINC_KEY_ASTERISK 170
157#define KINC_KEY_PLUS 171
158#define KINC_KEY_PIPE 172
159#define KINC_KEY_HYPHEN_MINUS 173
160#define KINC_KEY_OPEN_CURLY_BRACKET 174
161#define KINC_KEY_CLOSE_CURLY_BRACKET 175
162#define KINC_KEY_TILDE 176
163#define KINC_KEY_VOLUME_MUTE 181
164#define KINC_KEY_VOLUME_DOWN 182
165#define KINC_KEY_VOLUME_UP 183
166#define KINC_KEY_COMMA 188
167#define KINC_KEY_PERIOD 190
168#define KINC_KEY_SLASH 191
169#define KINC_KEY_BACK_QUOTE 192
170#define KINC_KEY_OPEN_BRACKET 219
171#define KINC_KEY_BACK_SLASH 220
172#define KINC_KEY_CLOSE_BRACKET 221
173#define KINC_KEY_QUOTE 222
174#define KINC_KEY_META 224
175#define KINC_KEY_ALT_GR 225
176#define KINC_KEY_WIN_ICO_HELP 227
177#define KINC_KEY_WIN_ICO_00 228
178#define KINC_KEY_WIN_ICO_CLEAR 230
179#define KINC_KEY_WIN_OEM_RESET 233
180#define KINC_KEY_WIN_OEM_JUMP 234
181#define KINC_KEY_WIN_OEM_PA1 235
182#define KINC_KEY_WIN_OEM_PA2 236
183#define KINC_KEY_WIN_OEM_PA3 237
184#define KINC_KEY_WIN_OEM_WSCTRL 238
185#define KINC_KEY_WIN_OEM_CUSEL 239
186#define KINC_KEY_WIN_OEM_ATTN 240
187#define KINC_KEY_WIN_OEM_FINISH 241
188#define KINC_KEY_WIN_OEM_COPY 242
189#define KINC_KEY_WIN_OEM_AUTO 243
190#define KINC_KEY_WIN_OEM_ENLW 244
191#define KINC_KEY_WIN_OEM_BACK_TAB 245
192#define KINC_KEY_ATTN 246
193#define KINC_KEY_CRSEL 247
194#define KINC_KEY_EXSEL 248
195#define KINC_KEY_EREOF 249
196#define KINC_KEY_PLAY 250
197#define KINC_KEY_ZOOM 251
198#define KINC_KEY_PA1 253
199#define KINC_KEY_WIN_OEM_CLEAR 254
237void kinc_internal_keyboard_trigger_key_down(
int key_code);
238void kinc_internal_keyboard_trigger_key_up(
int key_code);
239void kinc_internal_keyboard_trigger_key_press(
unsigned character);
241#ifdef KINC_IMPLEMENTATION_INPUT
242#define KINC_IMPLEMENTATION
245#ifdef KINC_IMPLEMENTATION
250static void (*keyboard_key_down_callback)(
int ,
void * ) = NULL;
251static void *keyboard_key_down_callback_data = NULL;
252static void (*keyboard_key_up_callback)(
int ,
void * ) = NULL;
253static void *keyboard_key_up_callback_data = NULL;
254static void (*keyboard_key_press_callback)(
unsigned ,
void * ) = NULL;
255static void *keyboard_key_press_callback_data = NULL;
258 keyboard_key_down_callback = value;
259 keyboard_key_down_callback_data = data;
263 keyboard_key_up_callback = value;
264 keyboard_key_up_callback_data = data;
268 keyboard_key_press_callback = value;
269 keyboard_key_press_callback_data = data;
272void kinc_internal_keyboard_trigger_key_down(
int key_code) {
273 if (keyboard_key_down_callback != NULL) {
274 keyboard_key_down_callback(key_code, keyboard_key_down_callback_data);
278void kinc_internal_keyboard_trigger_key_up(
int key_code) {
279 if (keyboard_key_up_callback != NULL) {
280 keyboard_key_up_callback(key_code, keyboard_key_up_callback_data);
284void kinc_internal_keyboard_trigger_key_press(
unsigned character) {
285 if (keyboard_key_press_callback != NULL) {
286 keyboard_key_press_callback(character, keyboard_key_press_callback_data);
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
KINC_FUNC void kinc_keyboard_set_key_press_callback(void(*value)(unsigned, void *), void *data)
Sets the keyboard-key-press-callback which is called when the system decides that a character came in...
KINC_FUNC bool kinc_keyboard_active(void)
Figure out whether the keyboard is currently shown if the system is using a software-keyboard.
KINC_FUNC void kinc_keyboard_set_key_up_callback(void(*value)(int, void *), void *data)
Sets the keyboard-key-up-callback which is called with a key-code when a key goes up....
KINC_FUNC void kinc_keyboard_hide(void)
Hide the keyboard if the system is using a software-keyboard.
KINC_FUNC void kinc_keyboard_set_key_down_callback(void(*value)(int, void *), void *data)
Sets the keyboard-key-down-callback which is called with a key-code when a key goes down....
KINC_FUNC void kinc_keyboard_show(void)
Show the keyboard if the system is using a software-keyboard.