Resize the video to the normal size on launch
[vlc/davidf-public.git] / include / vlc_keys.h
blob3275fedf4856b0b78bcb316fa33fe9d9ef5439f7
1 /*****************************************************************************
2 * vlc_keys.h: keycode defines
3 *****************************************************************************
4 * Copyright (C) 2003 the VideoLAN team
5 * $Id$
7 * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
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 General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef _VLC_KEYS_H
25 #define _VLC_KEYS_H 1
27 #define KEY_MODIFIER 0xFF000000
28 #define KEY_MODIFIER_ALT 0x01000000
29 #define KEY_MODIFIER_SHIFT 0x02000000
30 #define KEY_MODIFIER_CTRL 0x04000000
31 #define KEY_MODIFIER_META 0x08000000
32 #define KEY_MODIFIER_COMMAND 0x10000000
34 #define KEY_SPECIAL 0x00FF0000
35 #define KEY_LEFT 0x00010000
36 #define KEY_RIGHT 0x00020000
37 #define KEY_UP 0x00030000
38 #define KEY_DOWN 0x00040000
39 #define KEY_SPACE 0x00050000
40 #define KEY_ENTER 0x00060000
41 #define KEY_F1 0x00070000
42 #define KEY_F2 0x00080000
43 #define KEY_F3 0x00090000
44 #define KEY_F4 0x000A0000
45 #define KEY_F5 0x000B0000
46 #define KEY_F6 0x000C0000
47 #define KEY_F7 0x000D0000
48 #define KEY_F8 0x000E0000
49 #define KEY_F9 0x000F0000
50 #define KEY_F10 0x00100000
51 #define KEY_F11 0x00110000
52 #define KEY_F12 0x00120000
53 #define KEY_HOME 0x00130000
54 #define KEY_END 0x00140000
55 #define KEY_INSERT 0x00150000
56 #define KEY_DELETE 0x00160000
57 #define KEY_MENU 0x00170000
58 #define KEY_ESC 0x00180000
59 #define KEY_PAGEUP 0x00190000
60 #define KEY_PAGEDOWN 0x001A0000
61 #define KEY_TAB 0x001B0000
62 #define KEY_BACKSPACE 0x001C0000
63 #define KEY_MOUSEWHEELUP 0x001D0000
64 #define KEY_MOUSEWHEELDOWN 0x001E0000
65 #define KEY_MOUSEWHEELLEFT 0x001F0000
66 #define KEY_MOUSEWHEELRIGHT 0x00200000
68 /* TODO:
69 * The media keys are only used in win32. Support for other OSes needs to
70 * be added */
71 #define KEY_BROWSER_BACK 0x001F0000
72 #define KEY_BROWSER_FORWARD 0x00200000
73 #define KEY_BROWSER_REFRESH 0x00210000
74 #define KEY_BROWSER_STOP 0x00220000
75 #define KEY_BROWSER_SEARCH 0x00230000
76 #define KEY_BROWSER_FAVORITES 0x00240000
77 #define KEY_BROWSER_HOME 0x00250000
78 #define KEY_VOLUME_MUTE 0x00260000
79 #define KEY_VOLUME_DOWN 0x00270000
80 #define KEY_VOLUME_UP 0x00280000
81 #define KEY_MEDIA_NEXT_TRACK 0x00290000
82 #define KEY_MEDIA_PREV_TRACK 0x002a0000
83 #define KEY_MEDIA_STOP 0x002b0000
84 #define KEY_MEDIA_PLAY_PAUSE 0x002c0000
86 #define KEY_ASCII 0x0000007F
87 #define KEY_UNSET 0
89 typedef struct key_descriptor_s
91 const char *psz_key_string;
92 int i_key_code;
93 } key_descriptor_t;
95 #define ADD_KEY(a) { a, *a }
97 static const struct key_descriptor_s vlc_modifiers[] =
99 { "Alt", KEY_MODIFIER_ALT },
100 { "Shift", KEY_MODIFIER_SHIFT },
101 { "Ctrl", KEY_MODIFIER_CTRL },
102 { "Meta", KEY_MODIFIER_META },
103 { "Command", KEY_MODIFIER_COMMAND }
106 static const struct key_descriptor_s vlc_keys[] =
108 { "Unset", KEY_UNSET },
109 { "Left", KEY_LEFT },
110 { "Right", KEY_RIGHT },
111 { "Up", KEY_UP },
112 { "Down", KEY_DOWN },
113 { "Space", KEY_SPACE },
114 { "Enter", KEY_ENTER },
115 { "F1", KEY_F1 },
116 { "F2", KEY_F2 },
117 { "F3", KEY_F3 },
118 { "F4", KEY_F4 },
119 { "F5", KEY_F5 },
120 { "F6", KEY_F6 },
121 { "F7", KEY_F7 },
122 { "F8", KEY_F8 },
123 { "F9", KEY_F9 },
124 { "F10", KEY_F10 },
125 { "F11", KEY_F11 },
126 { "F12", KEY_F12 },
127 { "Home", KEY_HOME },
128 { "End", KEY_END },
129 { "Insert", KEY_INSERT },
130 { "Delete", KEY_DELETE },
131 { "Menu", KEY_MENU },
132 { "Esc", KEY_ESC },
133 { "Page Up", KEY_PAGEUP },
134 { "Page Down", KEY_PAGEDOWN },
135 { "Tab", KEY_TAB },
136 { "Backspace", KEY_BACKSPACE },
137 { "Mouse Wheel Up", KEY_MOUSEWHEELUP },
138 { "Mouse Wheel Down", KEY_MOUSEWHEELDOWN },
139 { "0", '0' },
140 { "1", '1' },
141 { "2", '2' },
142 { "3", '3' },
143 { "4", '4' },
144 { "5", '5' },
145 { "6", '6' },
146 { "7", '7' },
147 { "8", '8' },
148 { "9", '9' },
149 { "a", 'a' },
150 { "b", 'b' },
151 { "c", 'c' },
152 { "d", 'd' },
153 { "e", 'e' },
154 { "f", 'f' },
155 { "g", 'g' },
156 { "h", 'h' },
157 { "i", 'i' },
158 { "j", 'j' },
159 { "k", 'k' },
160 { "l", 'l' },
161 { "m", 'm' },
162 { "n", 'n' },
163 { "o", 'o' },
164 { "p", 'p' },
165 { "q", 'q' },
166 { "r", 'r' },
167 { "s", 's' },
168 { "t", 't' },
169 { "u", 'u' },
170 { "v", 'v' },
171 { "w", 'w' },
172 { "x", 'x' },
173 { "y", 'y' },
174 { "z", 'z' },
175 { "+", '+' },
176 { "=", '=' },
177 { "-", '-' },
178 { ",", ',' },
179 { ".", '.' },
180 { "<", '<' },
181 { ">", '>' },
182 { "`", '`' },
183 { "/", '/' },
184 { ";", ';' },
185 { "'", '\'' },
186 { "\\", '\\' },
187 { "[", '[' },
188 { "]", ']' },
189 { "*", '*' },
190 { "Browser Back", KEY_BROWSER_BACK },
191 { "Browser Forward", KEY_BROWSER_FORWARD },
192 { "Browser Refresh", KEY_BROWSER_REFRESH },
193 { "Browser Stop", KEY_BROWSER_STOP },
194 { "Browser Search", KEY_BROWSER_SEARCH },
195 { "Browser Favorites", KEY_BROWSER_FAVORITES },
196 { "Browser Home", KEY_BROWSER_HOME },
197 { "Volume Mute", KEY_VOLUME_MUTE },
198 { "Volume Down", KEY_VOLUME_DOWN },
199 { "Volume Up", KEY_VOLUME_UP },
200 { "Media Next Track", KEY_MEDIA_NEXT_TRACK },
201 { "Media Prev Track", KEY_MEDIA_PREV_TRACK },
202 { "Media Stop", KEY_MEDIA_STOP },
203 { "Media Play Pause", KEY_MEDIA_PLAY_PAUSE }
206 static inline const char *KeyToString( int i_key )
208 unsigned int i = 0;
209 for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
211 if ( vlc_keys[i].i_key_code == i_key )
213 return vlc_keys[i].psz_key_string;
216 return NULL;
219 static inline int StringToKey( char *psz_key )
221 unsigned int i = 0;
222 for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
224 if ( !strcmp( vlc_keys[i].psz_key_string, psz_key ))
226 return vlc_keys[i].i_key_code;
229 return 0;
232 typedef enum vlc_key {
233 ACTIONID_QUIT = 1,
234 ACTIONID_PLAY_PAUSE,
235 ACTIONID_PLAY,
236 ACTIONID_PAUSE,
237 ACTIONID_STOP,
238 ACTIONID_PREV,
239 ACTIONID_NEXT,
240 ACTIONID_SLOWER,
241 ACTIONID_FASTER,
242 ACTIONID_TOGGLE_FULLSCREEN,
243 ACTIONID_VOL_UP,
244 ACTIONID_VOL_DOWN,
245 ACTIONID_NAV_ACTIVATE,
246 ACTIONID_NAV_UP,
247 ACTIONID_NAV_DOWN,
248 ACTIONID_NAV_LEFT,
249 ACTIONID_NAV_RIGHT,
250 ACTIONID_JUMP_BACKWARD_EXTRASHORT,
251 ACTIONID_JUMP_FORWARD_EXTRASHORT,
252 ACTIONID_JUMP_BACKWARD_SHORT,
253 ACTIONID_JUMP_FORWARD_SHORT,
254 ACTIONID_JUMP_BACKWARD_MEDIUM,
255 ACTIONID_JUMP_FORWARD_MEDIUM,
256 ACTIONID_JUMP_BACKWARD_LONG,
257 ACTIONID_JUMP_FORWARD_LONG,
258 ACTIONID_POSITION,
259 ACTIONID_VOL_MUTE,
260 /* let ACTIONID_SET_BOOMARK* and ACTIONID_PLAY_BOOKMARK* be contiguous */
261 ACTIONID_SET_BOOKMARK1,
262 ACTIONID_SET_BOOKMARK2,
263 ACTIONID_SET_BOOKMARK3,
264 ACTIONID_SET_BOOKMARK4,
265 ACTIONID_SET_BOOKMARK5,
266 ACTIONID_SET_BOOKMARK6,
267 ACTIONID_SET_BOOKMARK7,
268 ACTIONID_SET_BOOKMARK8,
269 ACTIONID_SET_BOOKMARK9,
270 ACTIONID_SET_BOOKMARK10,
271 ACTIONID_PLAY_BOOKMARK1,
272 ACTIONID_PLAY_BOOKMARK2,
273 ACTIONID_PLAY_BOOKMARK3,
274 ACTIONID_PLAY_BOOKMARK4,
275 ACTIONID_PLAY_BOOKMARK5,
276 ACTIONID_PLAY_BOOKMARK6,
277 ACTIONID_PLAY_BOOKMARK7,
278 ACTIONID_PLAY_BOOKMARK8,
279 ACTIONID_PLAY_BOOKMARK9,
280 ACTIONID_PLAY_BOOKMARK10,
281 /* end of contiguous zone */
282 ACTIONID_SUBDELAY_UP,
283 ACTIONID_SUBDELAY_DOWN,
284 ACTIONID_HISTORY_BACK,
285 ACTIONID_HISTORY_FORWARD,
286 ACTIONID_AUDIO_TRACK,
287 ACTIONID_SUBTITLE_TRACK,
288 ACTIONID_CUBESPEED_UP,
289 ACTIONID_CUBESPEED_DOWN,
290 ACTIONID_INTF_SHOW,
291 ACTIONID_INTF_HIDE,
292 /* chapter and title navigation */
293 ACTIONID_TITLE_PREV,
294 ACTIONID_TITLE_NEXT,
295 ACTIONID_CHAPTER_PREV,
296 ACTIONID_CHAPTER_NEXT,
297 /* end of chapter and title navigation */
298 ACTIONID_AUDIODELAY_UP,
299 ACTIONID_AUDIODELAY_DOWN,
300 ACTIONID_SNAPSHOT,
301 ACTIONID_RECORD,
302 ACTIONID_DISC_MENU,
303 ACTIONID_ASPECT_RATIO,
304 ACTIONID_CROP,
305 ACTIONID_DEINTERLACE,
306 ACTIONID_ZOOM,
307 ACTIONID_UNZOOM,
308 ACTIONID_CROP_TOP,
309 ACTIONID_UNCROP_TOP,
310 ACTIONID_CROP_LEFT,
311 ACTIONID_UNCROP_LEFT,
312 ACTIONID_CROP_BOTTOM,
313 ACTIONID_UNCROP_BOTTOM,
314 ACTIONID_CROP_RIGHT,
315 ACTIONID_UNCROP_RIGHT,
316 ACTIONID_DUMP,
317 ACTIONID_RANDOM,
318 ACTIONID_LOOP,
319 ACTIONID_WALLPAPER,
320 ACTIONID_LEAVE_FULLSCREEN,
321 ACTIONID_MENU_ON,
322 ACTIONID_MENU_OFF,
323 ACTIONID_MENU_RIGHT,
324 ACTIONID_MENU_LEFT,
325 ACTIONID_MENU_UP,
326 ACTIONID_MENU_DOWN,
327 ACTIONID_MENU_SELECT,
328 /* Zoom */
329 ACTIONID_ZOOM_QUARTER,
330 ACTIONID_ZOOM_HALF,
331 ACTIONID_ZOOM_ORIGINAL,
332 ACTIONID_ZOOM_DOUBLE,
333 /* Cycle Through Audio Devices */
334 ACTIONID_AUDIODEVICE_CYCLE
335 } vlc_key_t;
336 #endif