23
|
1 /* Libvisual - The audio visualisation framework.
|
|
2 *
|
|
3 * Copyright (C) 2004, 2005 Dennis Smit <ds@nerds-incorporated.org>
|
|
4 *
|
|
5 * Authors: Dennis Smit <ds@nerds-incorporated.org>
|
|
6 *
|
|
7 * $Id:
|
|
8 *
|
|
9 * This program is free software; you can redistribute it and/or modify
|
|
10 * it under the terms of the GNU Lesser General Public License as
|
|
11 * published by the Free Software Foundation; either version 2.1
|
|
12 * of the License, or (at your option) any later version.
|
|
13 *
|
|
14 * This program is distributed in the hope that it will be useful,
|
|
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17 * GNU Lesser General Public License for more details.
|
|
18 *
|
|
19 * You should have received a copy of the GNU Lesser General Public License
|
|
20 * along with this program; if not, write to the Free Software
|
|
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
22 */
|
|
23
|
|
24 #ifndef _LV_KEYSYM_H
|
|
25 #define _LV_KEYSYM_H
|
|
26
|
|
27 #ifdef __cplusplus
|
|
28 extern "C" {
|
|
29 #endif /* __cplusplus */
|
|
30
|
|
31 /**
|
|
32 * Enumerate values used within the libvisual event system for keyboard events.
|
|
33 *
|
|
34 * The table is closely modelled after that of SDL and the SDL1.2
|
|
35 * SDLK defines can be directly translated to those of libvisual, however
|
|
36 * some keys are left out, but these are rarely or never used.
|
|
37 *
|
|
38 * The basic keys are also mapped as in the ASCII table so basic
|
|
39 * keyboard support is easy to implement within a libvisual client.
|
|
40 *
|
|
41 * @see visual_event_queue_add_keyboard
|
|
42 */
|
|
43 typedef enum {
|
|
44 VKEY_UNKNOWN = 0,
|
|
45 VKEY_FIRST = 0,
|
|
46 VKEY_BACKSPACE = 8,
|
|
47 VKEY_TAB = 9,
|
|
48 VKEY_CLEAR = 12,
|
|
49 VKEY_RETURN = 13,
|
|
50 VKEY_PAUSE = 19,
|
|
51 VKEY_ESCAPE = 27,
|
|
52 VKEY_SPACE = 32,
|
|
53 VKEY_EXCLAIM = 33,
|
|
54 VKEY_QUOTEDBL = 34,
|
|
55 VKEY_HASH = 35,
|
|
56 VKEY_DOLLAR = 36,
|
|
57 VKEY_AMPERSAND = 38,
|
|
58 VKEY_QUOTE = 39,
|
|
59 VKEY_LEFTPAREN = 40,
|
|
60 VKEY_RIGHTPAREN = 41,
|
|
61 VKEY_ASTERISK = 42,
|
|
62 VKEY_PLUS = 43,
|
|
63 VKEY_COMMA = 44,
|
|
64 VKEY_MINUS = 45,
|
|
65 VKEY_PERIOD = 46,
|
|
66 VKEY_SLASH = 47,
|
|
67 VKEY_0 = 48,
|
|
68 VKEY_1 = 49,
|
|
69 VKEY_2 = 50,
|
|
70 VKEY_3 = 51,
|
|
71 VKEY_4 = 52,
|
|
72 VKEY_5 = 53,
|
|
73 VKEY_6 = 54,
|
|
74 VKEY_7 = 55,
|
|
75 VKEY_8 = 56,
|
|
76 VKEY_9 = 57,
|
|
77 VKEY_COLON = 58,
|
|
78 VKEY_SEMICOLON = 59,
|
|
79 VKEY_LESS = 60,
|
|
80 VKEY_EQUALS = 61,
|
|
81 VKEY_GREATER = 62,
|
|
82 VKEY_QUESTION = 63,
|
|
83 VKEY_AT = 64,
|
|
84
|
|
85 /* Skip uppercase here because it's done via the VisKeyMod */
|
|
86 VKEY_LEFTBRACKET = 91,
|
|
87 VKEY_BACKSLASH = 92,
|
|
88 VKEY_RIGHTBRACKET = 93,
|
|
89 VKEY_CARET = 94,
|
|
90 VKEY_UNDERSCORE = 95,
|
|
91 VKEY_BACKQUOTE = 96,
|
|
92 VKEY_a = 97,
|
|
93 VKEY_b = 98,
|
|
94 VKEY_c = 99,
|
|
95 VKEY_d = 100,
|
|
96 VKEY_e = 101,
|
|
97 VKEY_f = 102,
|
|
98 VKEY_g = 103,
|
|
99 VKEY_h = 104,
|
|
100 VKEY_i = 105,
|
|
101 VKEY_j = 106,
|
|
102 VKEY_k = 107,
|
|
103 VKEY_l = 108,
|
|
104 VKEY_m = 109,
|
|
105 VKEY_n = 110,
|
|
106 VKEY_o = 111,
|
|
107 VKEY_p = 112,
|
|
108 VKEY_q = 113,
|
|
109 VKEY_r = 114,
|
|
110 VKEY_s = 115,
|
|
111 VKEY_t = 116,
|
|
112 VKEY_u = 117,
|
|
113 VKEY_v = 118,
|
|
114 VKEY_w = 119,
|
|
115 VKEY_x = 120,
|
|
116 VKEY_y = 121,
|
|
117 VKEY_z = 122,
|
|
118 VKEY_DELETE = 127,
|
|
119
|
|
120 /* Numeric keypad */
|
|
121 VKEY_KP0 = 256,
|
|
122 VKEY_KP1 = 257,
|
|
123 VKEY_KP2 = 258,
|
|
124 VKEY_KP3 = 259,
|
|
125 VKEY_KP4 = 260,
|
|
126 VKEY_KP5 = 261,
|
|
127 VKEY_KP6 = 262,
|
|
128 VKEY_KP7 = 263,
|
|
129 VKEY_KP8 = 264,
|
|
130 VKEY_KP9 = 265,
|
|
131 VKEY_KP_PERIOD = 266,
|
|
132 VKEY_KP_DIVIDE = 267,
|
|
133 VKEY_KP_MULTIPLY = 268,
|
|
134 VKEY_KP_MINUS = 269,
|
|
135 VKEY_KP_PLUS = 270,
|
|
136 VKEY_KP_ENTER = 271,
|
|
137 VKEY_KP_EQUALS = 272,
|
|
138
|
|
139 /* Arrows + Home/End pad */
|
|
140 VKEY_UP = 273,
|
|
141 VKEY_DOWN = 274,
|
|
142 VKEY_RIGHT = 275,
|
|
143 VKEY_LEFT = 276,
|
|
144 VKEY_INSERT = 277,
|
|
145 VKEY_HOME = 278,
|
|
146 VKEY_END = 279,
|
|
147 VKEY_PAGEUP = 280,
|
|
148 VKEY_PAGEDOWN = 281,
|
|
149
|
|
150 /* Function keys */
|
|
151 VKEY_F1 = 282,
|
|
152 VKEY_F2 = 283,
|
|
153 VKEY_F3 = 284,
|
|
154 VKEY_F4 = 285,
|
|
155 VKEY_F5 = 286,
|
|
156 VKEY_F6 = 287,
|
|
157 VKEY_F7 = 288,
|
|
158 VKEY_F8 = 289,
|
|
159 VKEY_F9 = 290,
|
|
160 VKEY_F10 = 291,
|
|
161 VKEY_F11 = 292,
|
|
162 VKEY_F12 = 293,
|
|
163 VKEY_F13 = 294,
|
|
164 VKEY_F14 = 295,
|
|
165 VKEY_F15 = 296,
|
|
166
|
|
167 /* Key state modifier keys */
|
|
168 VKEY_NUMLOCK = 300,
|
|
169 VKEY_CAPSLOCK = 301,
|
|
170 VKEY_SCROLLOCK = 302,
|
|
171 VKEY_RSHIFT = 303,
|
|
172 VKEY_LSHIFT = 304,
|
|
173 VKEY_RCTRL = 305,
|
|
174 VKEY_LCTRL = 306,
|
|
175 VKEY_RALT = 307,
|
|
176 VKEY_LALT = 308,
|
|
177 VKEY_RMETA = 309,
|
|
178 VKEY_LMETA = 310,
|
|
179 VKEY_LSUPER = 311, /* Left "Windows" key */
|
|
180 VKEY_RSUPER = 312, /* Right "Windows" key */
|
|
181 VKEY_MODE = 313, /* "Alt Gr" key */
|
|
182 VKEY_COMPOSE = 314, /* Multi-key compose key */
|
|
183
|
|
184 /* Miscellaneous function keys */
|
|
185 VKEY_HELP = 315,
|
|
186 VKEY_PRINT = 316,
|
|
187 VKEY_SYSREQ = 317,
|
|
188 VKEY_BREAK = 318,
|
|
189 VKEY_MENU = 319,
|
|
190
|
|
191 VKEY_LAST
|
|
192 } VisKey;
|
|
193
|
|
194 /**
|
|
195 * Enumerate values used within the libvisual event system to set modifier keys.
|
|
196 *
|
|
197 * Values can ben ORred together.
|
|
198 *
|
|
199 * @see visual_event_queue_add_keyboard
|
|
200 */
|
|
201 typedef enum {
|
|
202 VKMOD_NONE = 0x0000,
|
|
203 VKMOD_LSHIFT = 0x0001,
|
|
204 VKMOD_RSHIFT = 0x0002,
|
|
205 VKMOD_LCTRL = 0x0040,
|
|
206 VKMOD_RCTRL = 0x0080,
|
|
207 VKMOD_LALT = 0x0100,
|
|
208 VKMOD_RALT = 0x0200,
|
|
209 VKMOD_LMETA = 0x0400,
|
|
210 VKMOD_RMETA = 0x0800,
|
|
211 VKMOD_NUM = 0x1000,
|
|
212 VKMOD_CAPS = 0x2000,
|
|
213 VKMOD_MODE = 0x4000,
|
|
214 } VisKeyMod;
|
|
215
|
|
216 #define VKMOD_CTRL (VKMOD_LCTRL | VKMOD_RCTRL)
|
|
217 #define VKMOD_SHIFT (VKMOD_LSHIFT | VKMOD_RSHIFT)
|
|
218 #define VKMOD_ALT (VKMOD_LALT | VKMOD_RALT)
|
|
219 #define VKMOD_META (VKMOD_LMETA | VKMOD_RMETA)
|
|
220
|
|
221 typedef struct _VisKeySym VisKeySym;
|
|
222
|
|
223 /**
|
|
224 * Cantains data about the current keyboard state.
|
|
225 */
|
|
226 struct _VisKeySym {
|
|
227 VisKey sym; /**< Keyboard key to which everything relates. */
|
|
228 int mod; /**< Modifier vlags, Using key modifiers from the VisKeyMod enumerate. */
|
|
229 };
|
|
230
|
|
231 #ifdef __cplusplus
|
|
232 }
|
|
233 #endif /* __cplusplus */
|
|
234
|
|
235 #endif /* _LV_KEYSYM_H */
|