libt3widget
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules
key.h
1 /* Copyright (C) 2011-2013 G.P. Halkes
2  This program is free software: you can redistribute it and/or modify
3  it under the terms of the GNU General Public License version 3, as
4  published by the Free Software Foundation.
5 
6  This program is distributed in the hope that it will be useful,
7  but WITHOUT ANY WARRANTY; without even the implied warranty of
8  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  GNU General Public License for more details.
10 
11  You should have received a copy of the GNU General Public License
12  along with this program. If not, see <http://www.gnu.org/licenses/>.
13 */
14 #ifndef T3_WIDGET_KEYS_H
15 #define T3_WIDGET_KEYS_H
16 
17 #include <climits>
18 #include <t3widget/widget_api.h>
19 
20 namespace t3_widget {
21 
22 #if INT_MAX < 2147483647L
23 
24 typedef long key_t;
25 #else
26 typedef int key_t;
27 #endif
28 
29 enum {
30  EKEY_FIRST_SPECIAL = 0x110000,
31 };
32 
34 enum {
35  EKEY_IGNORE = (key_t) -1,
36 
37  EKEY_END = EKEY_FIRST_SPECIAL,
38  EKEY_HOME,
39  EKEY_PGUP,
40  EKEY_PGDN,
41  EKEY_LEFT,
42  EKEY_RIGHT,
43  EKEY_UP,
44  EKEY_DOWN,
45  EKEY_DEL,
46  EKEY_INS,
47  EKEY_BS,
48  EKEY_NL,
49  EKEY_KP_CENTER,
50 
51  EKEY_KP_END,
52  EKEY_KP_HOME,
53  EKEY_KP_PGUP,
54  EKEY_KP_PGDN,
55  EKEY_KP_LEFT,
56  EKEY_KP_RIGHT,
57  EKEY_KP_UP,
58  EKEY_KP_DOWN,
59  EKEY_KP_DEL,
60  EKEY_KP_INS,
61  EKEY_KP_NL,
62  EKEY_KP_DIV,
63  EKEY_KP_MUL,
64  EKEY_KP_PLUS,
65  EKEY_KP_MINUS,
66 
67  EKEY_F1 = 0x110100,
68  EKEY_F2,
69  EKEY_F3,
70  EKEY_F4,
71  EKEY_F5,
72  EKEY_F6,
73  EKEY_F7,
74  EKEY_F8,
75  EKEY_F9,
76  EKEY_F10,
77  EKEY_F11,
78  EKEY_F12,
79  EKEY_F13,
80  EKEY_F14,
81  EKEY_F15,
82  EKEY_F16,
83  EKEY_F17,
84  EKEY_F18,
85  EKEY_F19,
86  EKEY_F20,
87  EKEY_F21,
88  EKEY_F22,
89  EKEY_F23,
90  EKEY_F24,
91  EKEY_F25,
92  EKEY_F26,
93  EKEY_F27,
94  EKEY_F28,
95  EKEY_F29,
96  EKEY_F30,
97  EKEY_F31,
98  EKEY_F32,
99  EKEY_F33,
100  EKEY_F34,
101  EKEY_F35,
102  EKEY_F36,
103 
104  /* Make sure the synthetic keys are out of the way of future aditions. */
106  EKEY_RESIZE = 0x111000,
119 
121  EKEY_ESC = 27,
123  EKEY_SHIFT = 0x40000000,
125  EKEY_META = 0x20000000,
127  EKEY_CTRL = 0x10000000,
129  EKEY_PROTECT = 0x08000000,
131  EKEY_KEY_MASK = 0x1fffff
132 };
133 
135 T3_WIDGET_API key_t read_key(void);
149 T3_WIDGET_API void set_key_timeout(int msec);
150 
155 T3_WIDGET_API int get_key_timeout(void);
156 
165 T3_WIDGET_API void signal_update(void);
166 
167 }; // namespace
168 #endif
Key symbol used when a widget has indicated that a pressed key is a hot key.
Definition: key.h:112
Key symbol indicating that the terminal_settings_changed signal should be emitted.
Definition: key.h:116
The t3_widget namespace is contains all classes, functions and global variables in the libt3widget li...
Definition: autocompleter.cc:18
void signal_update(void)
Request the generation of the update_notification signal.
Definition: key.cc:740
Key symbol indicating that the signal_update function was called and the update_notification signal s...
Definition: key.h:114
Bit mask to retrieve the base key symbol.
Definition: key.h:131
Value indicating the shift key was pressed with a key press, used as bit-field.
Definition: key.h:123
void set_key_timeout(int msec)
Set the timeout for handling escape sequences.
Definition: key.cc:717
Value indicating the control key was pressed with a key press, used as bit-field. ...
Definition: key.h:127
long key_t
Integer type holding a single key symbol.
Definition: key.h:24
key_t read_key(void)
Retrieve a key from the input queue.
Definition: key.cc:312
Key symbol indicating that there is a new #mouse_event_t available in the mouse events queue...
Definition: key.h:118
int get_key_timeout(void)
Get the timeout for handling escape sequences.
Definition: key.cc:732
Value indicating the key was inserted using insert_protected_key, used as bit-field.
Definition: key.h:129
Value indicating the meta key was pressed with a key press, used as bit-field.
Definition: key.h:125
Key symbol indicating the terminal was resized.
Definition: key.h:106
Symbolic name for the escape key.
Definition: key.h:121