This is called to check for keyboard input. In this function:
- check if there are any input events
- if there are input events, fill key_input and return 1. otherwise return 0. If 1 is returned this will be called again to check for more events.
- Parameters
-
[out] | key_input | fill in the InputEvent structure to return key,modifier values. |
- Returns
- if there is a key, return 1 otherwise return 0.
Special keys:
10 #define F10_KEY 0x4400
12 #define PAGE_UP 0x4900
13 #define PAGE_DOWN 0x5100
14 #define CURS_UP 0x4800
15 #define CURS_DOWN 0x5000
16 #define CURS_LEFT 0x4B00
17 #define CURS_RIGHT 0x4D00
19 #define ESC_KEY 0x001B
20 #define ENTER_KEY 0x000D
Modifier: If you are using SDL you do not need to modify the modifier value as they match the value.
1 #define ELKMOD_NONE 0x0000
2 #define ELKMOD_LSHIFT 0x0001
3 #define ELKMOD_RSHIFT 0x0002
4 #define ELKMOD_LCTRL 0x0040
5 #define ELKMOD_RCTRL 0x0080
6 #define ELKMOD_LALT 0x0100
7 #define ELKMOD_RALT 0x0200
8 #define ELKMOD_LMETA 0x0400
9 #define ELKMOD_RMETA 0x0800,
10 #define ELKMOD_NUM 0x1000
11 #define ELKMOD_CAPS 0x2000
12 #define ELKMOD_MODE 0x4000