README: mention SDL2 backend
[rofl0r-concol.git] / console_keys.h
blobf70855a3af3d890698f70736f86d21a3b11469a6
1 #ifndef CONSOLE_KEYS_H
2 #define CONSOLE_KEYS_H
4 /* good old DOS...
5 #define CURSOR_UP 72
6 #define CURSOR_DOWN 80
7 #define CURSOR_LEFT 75
8 #define CURSOR_RIGHT 77
9 */
11 // we use first 9 bits for keys and special keys.
12 #define CK_UNDEF 0
13 #define CK_ERR CK_UNDEF
14 #define CK_QUIT 1
15 #define CK_TAB 9
16 #define CK_RETURN '\r'
17 #define CK_ESCAPE 27
18 // +/- on numeric pad
19 #define CK_PLUS 43
20 #define CK_MINUS 45
22 #define CK_PAGE_UP 0x100
23 #define CK_PAGE_DOWN 0x101
24 #define CK_CURSOR_UP 0x102
25 #define CK_CURSOR_DOWN 0x103
26 #define CK_CURSOR_LEFT 0x104
27 #define CK_CURSOR_RIGHT 0x105
28 #define CK_LSHIFT 0x106
29 #define CK_RSHIFT 0x107
30 #define CK_LALT 0x108
31 #define CK_RALT 0x109
32 #define CK_ALTGR 0x10A
33 #define CK_LFLAG 0x10B
34 #define CK_RFLAG 0x10C
35 #define CK_CONTEXT 0x10D
36 #define CK_LCTRL 0x10E
37 #define CK_RCTRL 0x10F
38 #define CK_F1 0x110
39 #define CK_F2 0x111
40 #define CK_F3 0x112
41 #define CK_F4 0x113
42 #define CK_F5 0x114
43 #define CK_F6 0x115
44 #define CK_F7 0x116
45 #define CK_F8 0x117
46 #define CK_F9 0x118
47 #define CK_F10 0x119
48 #define CK_F11 0x11A
49 #define CK_F12 0x11B
50 #define CK_DEL 0x11C
51 #define CK_BACKSPACE 0x11D
52 //#define CK_RETURN 0x11E
53 // 0x11E is free for usage
54 #define CK_HOME 0x11F
55 #define CK_END 0x120
56 #define CK_INS 0x121
59 #define CK_MASK ((1 << 9) - 1)
61 // use higher bits for events and modifiers.
62 #define CK_EVENT_BIT_FIRST 9
63 #define CK_RESIZE_EVENT (1 << CK_EVENT_BIT_FIRST)
64 #define CK_EVENT_BIT_LAST (CK_EVENT_BIT_FIRST + 1)
65 #define CK_MOUSE_EVENT (1 << (CK_EVENT_BIT_LAST))
66 #define CK_EVENT_MASK ((1 << CK_EVENT_BIT_FIRST) | (1 << (CK_EVENT_BIT_LAST)))
68 #define CK_MOD_BIT_FIRST (CK_EVENT_BIT_LAST + 1)
69 #define CK_AND_EVENT_MASK ((1 << CK_MOD_BIT_FIRST) - 1)
71 #define CK_MOD_ALT (1 << (CK_MOD_BIT_FIRST))
72 #define CK_MOD_ALTGR (1 << (CK_MOD_BIT_FIRST + 1))
73 #define CK_MOD_SHIFT (1 << (CK_MOD_BIT_FIRST + 2))
74 #define CK_MOD_CTRL (1 << (CK_MOD_BIT_FIRST + 3))
75 #define CK_MOD_FLAG (1 << (CK_MOD_BIT_FIRST + 4))
76 #define CK_MOD_CONTEXT (1 << (CK_MOD_BIT_FIRST + 5))
77 #define CK_MOD_NUMERICPAD (1 << (CK_MOD_BIT_FIRST + 6))
79 #endif