VLC 4.0.0-dev
vlc_actions.h
Go to the documentation of this file.
1/*****************************************************************************
2 * vlc_actions.h: handle vlc actions
3 *****************************************************************************
4 * Copyright (C) 2003-2016 VLC authors and VideoLAN
5 *
6 * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
22
23#ifndef VLC_ACTIONS_H
24#define VLC_ACTIONS_H 1
25
26# include <vlc_mouse.h>
27
28/* Called from src/libvlc.c */
29int
31
32/* Called from src/libvlc.c */
33void
35
36/**
37 * \file
38 * This file defines keys and functions
39 */
40
41#define KEY_MODIFIER 0xFF000000
42#define KEY_MODIFIER_ALT 0x01000000
43#define KEY_MODIFIER_SHIFT 0x02000000
44#define KEY_MODIFIER_CTRL 0x04000000
45#define KEY_MODIFIER_META 0x08000000
46#define KEY_MODIFIER_COMMAND 0x10000000
48#define KEY_UNSET 0x00000000
49#define KEY_BACKSPACE 0x08
50#define KEY_TAB 0x09
51#define KEY_ENTER 0x0D
52#define KEY_ESC 0x1B
53/* End of Unicode range: 0x0010FFFF */
54#define KEY_LEFT 0x00200000
55#define KEY_RIGHT 0x00210000
56#define KEY_UP 0x00220000
57#define KEY_DOWN 0x00230000
58#define KEY_F(n) (0x00230000 + ((n) << 16))
59#define KEY_F1 KEY_F(1)
60#define KEY_F2 KEY_F(2)
61#define KEY_F3 KEY_F(3)
62#define KEY_F4 KEY_F(4)
63#define KEY_F5 KEY_F(5)
64#define KEY_F6 KEY_F(6)
65#define KEY_F7 KEY_F(7)
66#define KEY_F8 KEY_F(8)
67#define KEY_F9 KEY_F(9)
68#define KEY_F10 KEY_F(10)
69#define KEY_F11 KEY_F(11)
70#define KEY_F12 KEY_F(12)
71/* KEY_F35 0x00460000 */
72#define KEY_HOME 0x00470000
73#define KEY_END 0x00480000
74#define KEY_INSERT 0x00490000
75#define KEY_DELETE 0x004A0000
76#define KEY_MENU 0x004B0000
77#define KEY_PAGEUP 0x004C0000
78#define KEY_PAGEDOWN 0x004D0000
79#define KEY_PRINT 0x004E0000
80#define KEY_PAUSE 0x004F0000
81#define KEY_BROWSER_BACK 0x00500000
82#define KEY_BROWSER_FORWARD 0x00510000
83#define KEY_BROWSER_REFRESH 0x00520000
84#define KEY_BROWSER_STOP 0x00530000
85#define KEY_BROWSER_SEARCH 0x00540000
86#define KEY_BROWSER_FAVORITES 0x00550000
87#define KEY_BROWSER_HOME 0x00560000
88#define KEY_VOLUME_MUTE 0x00570000
89#define KEY_VOLUME_DOWN 0x00580000
90#define KEY_VOLUME_UP 0x00590000
91#define KEY_MEDIA_NEXT_TRACK 0x005A0000
92#define KEY_MEDIA_PREV_TRACK 0x005B0000
93#define KEY_MEDIA_STOP 0x005C0000
94#define KEY_MEDIA_PLAY_PAUSE 0x005D0000
95#define KEY_MEDIA_RECORD 0x005E0000
96#define KEY_MEDIA_REWIND 0x005F0000
97#define KEY_MEDIA_FORWARD 0x00600000
98#define KEY_MEDIA_REPEAT 0x00610000
99#define KEY_MEDIA_SHUFFLE 0x00620000
100#define KEY_MEDIA_SUBTITLE 0x00630000
101#define KEY_MEDIA_AUDIO 0x00640000
102#define KEY_MEDIA_ANGLE 0x00650000
103#define KEY_MEDIA_TIME 0x00660000
104#define KEY_MEDIA_FRAME_PREV 0x00670000
105#define KEY_MEDIA_FRAME_NEXT 0x00680000
106#define KEY_MEDIA_SELECT 0x00690000
107#define KEY_MEDIA_VIEW 0x006A0000
108#define KEY_MEDIA_MENU 0x006B0000
109#define KEY_ZOOM_IN 0x006C0000
110#define KEY_ZOOM_OUT 0x006D0000
111#define KEY_BRIGHTNESS_UP 0x006E0000
112#define KEY_BRIGHTNESS_DOWN 0x006F0000
114#define KEY_MOUSEWHEELUP 0x00F00000
115#define KEY_MOUSEWHEELDOWN 0x00F10000
116#define KEY_MOUSEWHEELLEFT 0x00F20000
117#define KEY_MOUSEWHEELRIGHT 0x00F30000
118#define KEY_MOUSEWHEEL_FROM_BUTTON(button) \
119 (KEY_MOUSEWHEELUP | ((button - MOUSE_BUTTON_WHEEL_UP) << 16))
120
121VLC_API char *vlc_keycode2str(uint_fast32_t i_key, bool locale) VLC_USED;
122VLC_API uint_fast32_t vlc_str2keycode(const char *str) VLC_USED;
123
124typedef enum vlc_action_id {
127 /* intf actions */
132 /* playlist interaction */
136 /* playback */
139 /* playlist bookmarks */
160 /* player state */
166 /* input seeking */
176 /* program SID, chapter and title navigation */
184 /* audio / subtitle track */
188 /* audio / subtitle delay */
193 /* subtitle toggle */
195 /* dual subtitle control */
197 /* subtitle sync */
202 /* subtitle display */
208 /* input rate */
214 /* input navigation */
220 /* input recording */
222 /* viewpoint */
227 /* aout actions */
232 /* all vouts actions */
237 /* vout aspect ratio */
239 /* vout cropping */
249 /* vout deinterlacing */
252 /* vout scaling / zooming */
262 /* Combo Actions */
267/**
268 * Get the action ID from an action key name
269 * \return the action ID or ACTIONID_NONE on error.
270 */
272vlc_actions_get_id(const char *psz_key_name);
273
274/**
275 * Get keycodes from a action key name and vlc configuration
276 * \return The number of keycodes for this action, or 0 in case of an error.
277 * The list needs to be released with free()
278 */
279VLC_API size_t
280vlc_actions_get_keycodes(vlc_object_t *p_obj, const char *psz_key_name,
281 bool b_global, uint_fast32_t **pp_keycodes );
282#define vlc_actions_get_keycodes(a, b, c, d) vlc_actions_get_keycodes(VLC_OBJECT(a), b, c, d)
284/**
285 * Get a list a key names
286 * \return A NULL terminated list of const char *
287 */
288VLC_API const char* const*
290#define vlc_actions_get_key_names(x) vlc_actions_get_key_names(VLC_OBJECT(x))
292#endif
#define VLC_USED
Definition: fourcc_gen.c:32
#define VLC_API
Definition: fourcc_gen.c:31
Definition: vlc_objects.h:91
VLC object common members.
Definition: vlc_objects.h:45
#define vlc_actions_get_keycodes(a, b, c, d)
Definition: vlc_actions.h:283
vlc_action_id
Definition: vlc_actions.h:125
@ ACTIONID_PLAY_BOOKMARK5
Definition: vlc_actions.h:155
@ ACTIONID_VIEWPOINT_FOV_IN
Definition: vlc_actions.h:224
@ ACTIONID_SUBSYNC_MARKSUB
Definition: vlc_actions.h:200
@ ACTIONID_AUDIODELAY_DOWN
Definition: vlc_actions.h:190
@ ACTIONID_VIEWPOINT_FOV_OUT
Definition: vlc_actions.h:225
@ ACTIONID_INTF_HIDE
Definition: vlc_actions.h:130
@ ACTIONID_ZOOM
Definition: vlc_actions.h:257
@ ACTIONID_DEINTERLACE_MODE
Definition: vlc_actions.h:252
@ ACTIONID_SET_BOOKMARK3
Definition: vlc_actions.h:143
@ ACTIONID_PLAY_CLEAR
Definition: vlc_actions.h:134
@ ACTIONID_ZOOM_QUARTER
Definition: vlc_actions.h:259
@ ACTIONID_SET_BOOKMARK9
Definition: vlc_actions.h:149
@ ACTIONID_STOP
Definition: vlc_actions.h:165
@ ACTIONID_SUBDELAY_UP
Definition: vlc_actions.h:193
@ ACTIONID_RATE_SLOWER_FINE
Definition: vlc_actions.h:213
@ ACTIONID_UNZOOM
Definition: vlc_actions.h:258
@ ACTIONID_SET_BOOKMARK7
Definition: vlc_actions.h:147
@ ACTIONID_TITLE_NEXT
Definition: vlc_actions.h:181
@ ACTIONID_DISC_MENU
Definition: vlc_actions.h:184
@ ACTIONID_SUBSYNC_RESET
Definition: vlc_actions.h:202
@ ACTIONID_VOL_UP
Definition: vlc_actions.h:230
@ ACTIONID_INTF_TOGGLE_FSC
Definition: vlc_actions.h:129
@ ACTIONID_SCALE_DOWN
Definition: vlc_actions.h:256
@ ACTIONID_LEAVE_FULLSCREEN
Definition: vlc_actions.h:235
@ ACTIONID_JUMP_FORWARD_SHORT
Definition: vlc_actions.h:171
@ ACTIONID_PREV
Definition: vlc_actions.h:135
@ ACTIONID_PLAY_BOOKMARK10
Definition: vlc_actions.h:160
@ ACTIONID_PLAY_BOOKMARK7
Definition: vlc_actions.h:157
@ ACTIONID_CHAPTER_NEXT
Definition: vlc_actions.h:183
@ ACTIONID_SUBTITLE_TEXT_SCALE_UP
Definition: vlc_actions.h:208
@ ACTIONID_VOL_MUTE
Definition: vlc_actions.h:231
@ ACTIONID_SUBTITLE_TRACK
Definition: vlc_actions.h:188
@ ACTIONID_SUBPOS_DOWN
Definition: vlc_actions.h:204
@ ACTIONID_JUMP_BACKWARD_SHORT
Definition: vlc_actions.h:170
@ ACTIONID_AUDIODELAY_UP
Definition: vlc_actions.h:191
@ ACTIONID_JUMP_FORWARD_MEDIUM
Definition: vlc_actions.h:173
@ ACTIONID_SUBTITLE_TEXT_SCALE_NORMAL
Definition: vlc_actions.h:206
@ ACTIONID_SET_BOOKMARK10
Definition: vlc_actions.h:150
@ ACTIONID_JUMP_BACKWARD_EXTRASHORT
Definition: vlc_actions.h:168
@ ACTIONID_CROP_TOP
Definition: vlc_actions.h:242
@ ACTIONID_VIEWPOINT_ROLL_ANTICLOCK
Definition: vlc_actions.h:227
@ ACTIONID_RATE_FASTER_FINE
Definition: vlc_actions.h:214
@ ACTIONID_TOGGLE_FULLSCREEN
Definition: vlc_actions.h:234
@ ACTIONID_PLAY
Definition: vlc_actions.h:163
@ ACTIONID_SCALE_UP
Definition: vlc_actions.h:255
@ ACTIONID_SUBTITLE_CONTROL_SECONDARY
Definition: vlc_actions.h:197
@ ACTIONID_JUMP_BACKWARD_MEDIUM
Definition: vlc_actions.h:172
@ ACTIONID_SNAPSHOT
Definition: vlc_actions.h:236
@ ACTIONID_RATE_FASTER
Definition: vlc_actions.h:212
@ ACTIONID_UNCROP_RIGHT
Definition: vlc_actions.h:249
@ ACTIONID_PROGRAM_SID_PREV
Definition: vlc_actions.h:178
@ ACTIONID_NAV_DOWN
Definition: vlc_actions.h:218
@ ACTIONID_COMBO_VOL_FOV_DOWN
Definition: vlc_actions.h:264
@ ACTIONID_PAUSE
Definition: vlc_actions.h:164
@ ACTIONID_CROP
Definition: vlc_actions.h:241
@ ACTIONID_CROP_LEFT
Definition: vlc_actions.h:244
@ ACTIONID_PLAY_BOOKMARK4
Definition: vlc_actions.h:154
@ ACTIONID_COMBO_VOL_FOV_UP
Definition: vlc_actions.h:265
@ ACTIONID_RECORD
Definition: vlc_actions.h:222
@ ACTIONID_JUMP_FORWARD_EXTRASHORT
Definition: vlc_actions.h:169
@ ACTIONID_JUMP_BACKWARD_LONG
Definition: vlc_actions.h:174
@ ACTIONID_PLAY_PAUSE
Definition: vlc_actions.h:162
@ ACTIONID_LOOP
Definition: vlc_actions.h:138
@ ACTIONID_SUBSYNC_MARKAUDIO
Definition: vlc_actions.h:199
@ ACTIONID_JUMP_FORWARD_LONG
Definition: vlc_actions.h:175
@ ACTIONID_PLAY_BOOKMARK3
Definition: vlc_actions.h:153
@ ACTIONID_TITLE_PREV
Definition: vlc_actions.h:180
@ ACTIONID_CROP_RIGHT
Definition: vlc_actions.h:248
@ ACTIONID_NAV_LEFT
Definition: vlc_actions.h:219
@ ACTIONID_FRAME_NEXT
Definition: vlc_actions.h:166
@ ACTIONID_SUBTITLE_REVERSE_TRACK
Definition: vlc_actions.h:187
@ ACTIONID_SET_BOOKMARK4
Definition: vlc_actions.h:144
@ ACTIONID_SET_BOOKMARK5
Definition: vlc_actions.h:145
@ ACTIONID_DEINTERLACE
Definition: vlc_actions.h:251
@ ACTIONID_AUDIO_TRACK
Definition: vlc_actions.h:186
@ ACTIONID_NAV_UP
Definition: vlc_actions.h:217
@ ACTIONID_CROP_BOTTOM
Definition: vlc_actions.h:246
@ ACTIONID_NAV_RIGHT
Definition: vlc_actions.h:220
@ ACTIONID_CHAPTER_PREV
Definition: vlc_actions.h:182
@ ACTIONID_SUBTITLE_TEXT_SCALE_DOWN
Definition: vlc_actions.h:207
@ ACTIONID_RANDOM
Definition: vlc_actions.h:139
@ ACTIONID_PLAY_BOOKMARK8
Definition: vlc_actions.h:158
@ ACTIONID_RATE_SLOWER
Definition: vlc_actions.h:211
@ ACTIONID_RATE_NORMAL
Definition: vlc_actions.h:210
@ ACTIONID_TOGGLE_AUTOSCALE
Definition: vlc_actions.h:254
@ ACTIONID_POSITION
Definition: vlc_actions.h:176
@ ACTIONID_SUBTITLE_TOGGLE
Definition: vlc_actions.h:195
@ ACTIONID_SUBDELAY_DOWN
Definition: vlc_actions.h:192
@ ACTIONID_NONE
Definition: vlc_actions.h:126
@ ACTIONID_PLAY_BOOKMARK1
Definition: vlc_actions.h:151
@ ACTIONID_ASPECT_RATIO
Definition: vlc_actions.h:239
@ ACTIONID_ZOOM_HALF
Definition: vlc_actions.h:260
@ ACTIONID_SET_BOOKMARK1
Definition: vlc_actions.h:141
@ ACTIONID_UNCROP_LEFT
Definition: vlc_actions.h:245
@ ACTIONID_WALLPAPER
Definition: vlc_actions.h:237
@ ACTIONID_SET_BOOKMARK8
Definition: vlc_actions.h:148
@ ACTIONID_SET_BOOKMARK6
Definition: vlc_actions.h:146
@ ACTIONID_UNCROP_BOTTOM
Definition: vlc_actions.h:247
@ ACTIONID_NAV_ACTIVATE
Definition: vlc_actions.h:216
@ ACTIONID_SUBPOS_UP
Definition: vlc_actions.h:205
@ ACTIONID_ZOOM_DOUBLE
Definition: vlc_actions.h:262
@ ACTIONID_SET_BOOKMARK2
Definition: vlc_actions.h:142
@ ACTIONID_UNCROP_TOP
Definition: vlc_actions.h:243
@ ACTIONID_PLAY_BOOKMARK6
Definition: vlc_actions.h:156
@ ACTIONID_QUIT
Definition: vlc_actions.h:127
@ ACTIONID_VOL_DOWN
Definition: vlc_actions.h:229
@ ACTIONID_AUDIODEVICE_CYCLE
Definition: vlc_actions.h:232
@ ACTIONID_PLAY_BOOKMARK9
Definition: vlc_actions.h:159
@ ACTIONID_INTF_BOSS
Definition: vlc_actions.h:131
@ ACTIONID_PLAY_BOOKMARK2
Definition: vlc_actions.h:152
@ ACTIONID_SUBSYNC_APPLY
Definition: vlc_actions.h:201
@ ACTIONID_PROGRAM_SID_NEXT
Definition: vlc_actions.h:179
@ ACTIONID_VIEWPOINT_ROLL_CLOCK
Definition: vlc_actions.h:226
@ ACTIONID_NEXT
Definition: vlc_actions.h:136
@ ACTIONID_ZOOM_ORIGINAL
Definition: vlc_actions.h:261
@ ACTIONID_INTF_POPUP_MENU
Definition: vlc_actions.h:132
uint_fast32_t vlc_str2keycode(const char *str)
Parse a human-readable string representation of a VLC key code.
Definition: actions.c:197
#define vlc_actions_get_key_names(x)
Definition: vlc_actions.h:291
int libvlc_InternalActionsInit(libvlc_int_t *p_libvlc)
Initializes the key map from configuration.
Definition: actions.c:524
void libvlc_InternalActionsClean(libvlc_int_t *p_libvlc)
Destroys the key map.
Definition: actions.c:579
enum vlc_action_id vlc_action_id_t
char * vlc_keycode2str(uint_fast32_t i_key, bool locale)
Format a human-readable and unique representation of a VLC key code (including modifiers).
Definition: actions.c:248
vlc_action_id_t vlc_actions_get_id(const char *psz_key_name)
Get the action ID from an action key name.
Definition: actions.c:609
This file is a collection of common definitions and types.