00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #define KEY_MODIFIER 0xFF000000
00025 #define KEY_MODIFIER_ALT 0x01000000
00026 #define KEY_MODIFIER_SHIFT 0x02000000
00027 #define KEY_MODIFIER_CTRL 0x04000000
00028 #define KEY_MODIFIER_META 0x08000000
00029 #define KEY_MODIFIER_COMMAND 0x10000000
00030
00031 #define KEY_SPECIAL 0x00FF0000
00032 #define KEY_LEFT 0x00010000
00033 #define KEY_RIGHT 0x00020000
00034 #define KEY_UP 0x00030000
00035 #define KEY_DOWN 0x00040000
00036 #define KEY_SPACE 0x00050000
00037 #define KEY_ENTER 0x00060000
00038 #define KEY_F1 0x00070000
00039 #define KEY_F2 0x00080000
00040 #define KEY_F3 0x00090000
00041 #define KEY_F4 0x000A0000
00042 #define KEY_F5 0x000B0000
00043 #define KEY_F6 0x000C0000
00044 #define KEY_F7 0x000D0000
00045 #define KEY_F8 0x000E0000
00046 #define KEY_F9 0x000F0000
00047 #define KEY_F10 0x00100000
00048 #define KEY_F11 0x00110000
00049 #define KEY_F12 0x00120000
00050 #define KEY_HOME 0x00130000
00051 #define KEY_END 0x00140000
00052 #define KEY_INSERT 0x00150000
00053 #define KEY_DELETE 0x00160000
00054 #define KEY_MENU 0x00170000
00055 #define KEY_ESC 0x00180000
00056 #define KEY_PAGEUP 0x00190000
00057 #define KEY_PAGEDOWN 0x001A0000
00058 #define KEY_TAB 0x001B0000
00059 #define KEY_BACKSPACE 0x001C0000
00060 #define KEY_MOUSEWHEELUP 0x001D0000
00061 #define KEY_MOUSEWHEELDOWN 0x001E0000
00062
00063 #define KEY_ASCII 0x0000007F
00064 #define KEY_UNSET 0
00065
00066 typedef struct key_descriptor_s
00067 {
00068 char *psz_key_string;
00069 int i_key_code;
00070 } key_descriptor_t;
00071
00072 #define ADD_KEY(a) { a, *a }
00073
00074 static const struct key_descriptor_s vlc_modifiers[] =
00075 {
00076 { "Alt", KEY_MODIFIER_ALT },
00077 { "Shift", KEY_MODIFIER_SHIFT },
00078 { "Ctrl", KEY_MODIFIER_CTRL },
00079 { "Meta", KEY_MODIFIER_META },
00080 { "Command", KEY_MODIFIER_COMMAND }
00081 };
00082
00083 static const struct key_descriptor_s vlc_keys[] =
00084 {
00085 { "Unset", KEY_UNSET },
00086 { "Left", KEY_LEFT },
00087 { "Right", KEY_RIGHT },
00088 { "Up", KEY_UP },
00089 { "Down", KEY_DOWN },
00090 { "Space", KEY_SPACE },
00091 { "Enter", KEY_ENTER },
00092 { "F1", KEY_F1 },
00093 { "F2", KEY_F2 },
00094 { "F3", KEY_F3 },
00095 { "F4", KEY_F4 },
00096 { "F5", KEY_F5 },
00097 { "F6", KEY_F6 },
00098 { "F7", KEY_F7 },
00099 { "F8", KEY_F8 },
00100 { "F9", KEY_F9 },
00101 { "F10", KEY_F10 },
00102 { "F11", KEY_F11 },
00103 { "F12", KEY_F12 },
00104 { "Home", KEY_HOME },
00105 { "End", KEY_END },
00106 { "Insert", KEY_INSERT },
00107 { "Delete", KEY_DELETE },
00108 { "Menu", KEY_MENU },
00109 { "Esc", KEY_ESC },
00110 { "Page Up", KEY_PAGEUP },
00111 { "Page Down", KEY_PAGEDOWN },
00112 { "Tab", KEY_TAB },
00113 { "Backspace", KEY_BACKSPACE },
00114 { "Mouse Wheel Up", KEY_MOUSEWHEELUP },
00115 { "Mouse Wheel Down", KEY_MOUSEWHEELDOWN },
00116 { "a", 'a' },
00117 { "b", 'b' },
00118 { "c", 'c' },
00119 { "d", 'd' },
00120 { "e", 'e' },
00121 { "f", 'f' },
00122 { "g", 'g' },
00123 { "h", 'h' },
00124 { "i", 'i' },
00125 { "j", 'j' },
00126 { "k", 'k' },
00127 { "l", 'l' },
00128 { "m", 'm' },
00129 { "n", 'n' },
00130 { "o", 'o' },
00131 { "p", 'p' },
00132 { "q", 'q' },
00133 { "r", 'r' },
00134 { "s", 's' },
00135 { "t", 't' },
00136 { "u", 'u' },
00137 { "v", 'v' },
00138 { "w", 'w' },
00139 { "x", 'x' },
00140 { "y", 'y' },
00141 { "z", 'z' },
00142 { "+", '+' },
00143 { "=", '=' },
00144 { "-", '-' },
00145 { ",", ',' },
00146 { ".", '.' },
00147 { "<", '<' },
00148 { ">", '>' },
00149 { "`", '`' },
00150 { "/", '/' },
00151 { ";", ';' },
00152 { "'", '\'' },
00153 { "\\", '\\' },
00154 { "[", '[' },
00155 { "]", ']' },
00156 { "*", '*' }
00157 };
00158
00159 static inline char *KeyToString( int i_key )
00160 {
00161 unsigned int i = 0;
00162 for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
00163 {
00164 if ( vlc_keys[i].i_key_code == i_key )
00165 {
00166 return vlc_keys[i].psz_key_string;
00167 }
00168 }
00169 return NULL;
00170 }
00171
00172 static inline int StringToKey( char *psz_key )
00173 {
00174 unsigned int i = 0;
00175 for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
00176 {
00177 if ( !strcmp( vlc_keys[i].psz_key_string, psz_key ))
00178 {
00179 return vlc_keys[i].i_key_code;
00180 }
00181 }
00182 return 0;
00183 }
00184
00185
00186 #define ACTIONID_QUIT 1
00187 #define ACTIONID_PLAY_PAUSE 2
00188 #define ACTIONID_PLAY 3
00189 #define ACTIONID_PAUSE 4
00190 #define ACTIONID_STOP 5
00191 #define ACTIONID_PREV 6
00192 #define ACTIONID_NEXT 7
00193 #define ACTIONID_SLOWER 8
00194 #define ACTIONID_FASTER 9
00195 #define ACTIONID_FULLSCREEN 10
00196 #define ACTIONID_VOL_UP 11
00197 #define ACTIONID_VOL_DOWN 12
00198 #define ACTIONID_NAV_ACTIVATE 13
00199 #define ACTIONID_NAV_UP 14
00200 #define ACTIONID_NAV_DOWN 15
00201 #define ACTIONID_NAV_LEFT 16
00202 #define ACTIONID_NAV_RIGHT 17
00203 #define ACTIONID_JUMP_BACKWARD_3SEC 18
00204 #define ACTIONID_JUMP_FORWARD_3SEC 19
00205 #define ACTIONID_JUMP_BACKWARD_10SEC 20
00206 #define ACTIONID_JUMP_FORWARD_10SEC 21
00207 #define ACTIONID_JUMP_BACKWARD_1MIN 22
00208 #define ACTIONID_JUMP_FORWARD_1MIN 23
00209 #define ACTIONID_JUMP_BACKWARD_5MIN 24
00210 #define ACTIONID_JUMP_FORWARD_5MIN 25
00211 #define ACTIONID_POSITION 26
00212 #define ACTIONID_VOL_MUTE 27
00213
00214 #define ACTIONID_SET_BOOKMARK1 28
00215 #define ACTIONID_SET_BOOKMARK2 29
00216 #define ACTIONID_SET_BOOKMARK3 39
00217 #define ACTIONID_SET_BOOKMARK4 31
00218 #define ACTIONID_SET_BOOKMARK5 32
00219 #define ACTIONID_SET_BOOKMARK6 33
00220 #define ACTIONID_SET_BOOKMARK7 34
00221 #define ACTIONID_SET_BOOKMARK8 35
00222 #define ACTIONID_SET_BOOKMARK9 36
00223 #define ACTIONID_SET_BOOKMARK10 37
00224 #define ACTIONID_PLAY_BOOKMARK1 38
00225 #define ACTIONID_PLAY_BOOKMARK2 39
00226 #define ACTIONID_PLAY_BOOKMARK3 40
00227 #define ACTIONID_PLAY_BOOKMARK4 41
00228 #define ACTIONID_PLAY_BOOKMARK5 42
00229 #define ACTIONID_PLAY_BOOKMARK6 43
00230 #define ACTIONID_PLAY_BOOKMARK7 44
00231 #define ACTIONID_PLAY_BOOKMARK8 45
00232 #define ACTIONID_PLAY_BOOKMARK9 46
00233 #define ACTIONID_PLAY_BOOKMARK10 47
00234
00235 #define ACTIONID_SUBDELAY_UP 48
00236 #define ACTIONID_SUBDELAY_DOWN 49
00237 #define ACTIONID_HISTORY_BACK 50
00238 #define ACTIONID_HISTORY_FORWARD 51
00239 #define ACTIONID_AUDIO_TRACK 52
00240 #define ACTIONID_SUBTITLE_TRACK 53
00241 #define ACTIONID_CUBESPEED_UP 54
00242 #define ACTIONID_CUBESPEED_DOWN 55
00243 #define ACTIONID_INTF_SHOW 56
00244 #define ACTIONID_INTF_HIDE 57
00245
00246 #define ACTIONID_TITLE_PREV 58
00247 #define ACTIONID_TITLE_NEXT 59
00248 #define ACTIONID_CHAPTER_PREV 60
00249 #define ACTIONID_CHAPTER_NEXT 61
00250
00251 #define ACTIONID_AUDIODELAY_UP 62
00252 #define ACTIONID_AUDIODELAY_DOWN 63
00253 #define ACTIONID_SNAPSHOT 64
00254 #define ACTIONID_RECORD 65
00255 #define ACTIONID_DISC_MENU 66