[vlc-devel] [PATCH] Added hotkey to leave fullscreen
Sergey Volk
sergey.volk at gmail.com
Thu May 10 17:29:43 CEST 2007
Hi,
Here is a patch, which add 'leave-fullscreen' action to hotkey module.
Default key to leave fullscreen mode is Escape.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070510/bc5091cd/attachment.html>
-------------- next part --------------
Index: include/vlc_keys.h
===================================================================
--- include/vlc_keys.h (revision 20042)
+++ include/vlc_keys.h (working copy)
@@ -230,7 +230,7 @@
#define ACTIONID_NEXT 7
#define ACTIONID_SLOWER 8
#define ACTIONID_FASTER 9
-#define ACTIONID_FULLSCREEN 10
+#define ACTIONID_TOGGLE_FULLSCREEN 10
#define ACTIONID_VOL_UP 11
#define ACTIONID_VOL_DOWN 12
#define ACTIONID_NAV_ACTIVATE 13
@@ -308,3 +308,4 @@
#define ACTIONID_RANDOM 81
#define ACTIONID_LOOP 82
#define ACTIONID_WALLPAPER 83
+#define ACTIONID_LEAVE_FULLSCREEN 84
Index: modules/control/hotkeys.c
===================================================================
--- modules/control/hotkeys.c (revision 20042)
+++ modules/control/hotkeys.c (working copy)
@@ -283,7 +283,7 @@
{
if( p_vout ) vout_Control( p_vout, VOUT_SNAPSHOT );
}
- else if( i_action == ACTIONID_FULLSCREEN )
+ else if( i_action == ACTIONID_TOGGLE_FULLSCREEN )
{
if( p_vout )
{
@@ -298,6 +298,13 @@
var_Set( p_playlist, "fullscreen", val );
}
}
+ else if( i_action == ACTIONID_LEAVE_FULLSCREEN )
+ {
+ if( p_vout && var_GetBool( p_vout, "fullscreen" ) )
+ {
+ var_SetBool( p_vout, "fullscreen", VLC_FALSE );
+ }
+ }
else if( i_action == ACTIONID_WALLPAPER )
{
if( p_vout )
Index: src/libvlc-module.c
===================================================================
--- src/libvlc-module.c (revision 20042)
+++ src/libvlc-module.c (working copy)
@@ -1021,8 +1021,10 @@
#define HOTKEY_CAT_LONGTEXT N_( "These settings are the global VLC key " \
"bindings, known as \"hotkeys\"." )
-#define FULLSCREEN_KEY_TEXT N_("Fullscreen")
-#define FULLSCREEN_KEY_LONGTEXT N_("Select the hotkey to use to swap fullscreen state.")
+#define TOGGLE_FULLSCREEN_KEY_TEXT N_("Fullscreen")
+#define TOGGLE_FULLSCREEN_KEY_LONGTEXT N_("Select the hotkey to use to swap fullscreen state.")
+#define LEAVE_FULLSCREEN_KEY_TEXT N_("Leave fullscreen")
+#define LEAVE_FULLSCREEN_KEY_LONGTEXT N_("Select the hotkey to use to leave fullscreen state.")
#define PLAY_PAUSE_KEY_TEXT N_("Play/Pause")
#define PLAY_PAUSE_KEY_LONGTEXT N_("Select the hotkey to use to swap paused state.")
#define PAUSE_KEY_TEXT N_("Pause only")
@@ -1807,7 +1809,8 @@
* show info KEY_MODIFIER_COMMAND|'i'
* help KEY_MODIFIER_COMMAND|'?'
*/
-# define KEY_FULLSCREEN KEY_MODIFIER_COMMAND|'f'
+# define KEY_TOGGLE_FULLSCREEN KEY_MODIFIER_COMMAND|'f'
+# define KEY_LEAVE_FULLSCREEN KEY_ESC
# define KEY_PLAY_PAUSE KEY_MODIFIER_COMMAND|'p'
# define KEY_PAUSE KEY_UNSET
# define KEY_PLAY KEY_UNSET
@@ -1892,7 +1895,8 @@
# define KEY_WALLPAPER KEY_MODIFIER_COMMAND|'w'
#else
-# define KEY_FULLSCREEN 'f'
+# define KEY_TOGGLE_FULLSCREEN 'f'
+# define KEY_LEAVE_FULLSCREEN KEY_ESC
# define KEY_PLAY_PAUSE KEY_SPACE
# define KEY_PAUSE KEY_UNSET
# define KEY_PLAY KEY_UNSET
@@ -1978,8 +1982,10 @@
# define KEY_WALLPAPER 'w'
#endif
- add_key( "key-fullscreen", KEY_FULLSCREEN, NULL, FULLSCREEN_KEY_TEXT,
- FULLSCREEN_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-toggle-fullscreen", KEY_TOGGLE_FULLSCREEN, NULL, TOGGLE_FULLSCREEN_KEY_TEXT,
+ TOGGLE_FULLSCREEN_KEY_LONGTEXT, VLC_FALSE );
+ add_key( "key-leave-fullscreen", KEY_LEAVE_FULLSCREEN, NULL, LEAVE_FULLSCREEN_KEY_TEXT,
+ LEAVE_FULLSCREEN_KEY_LONGTEXT, VLC_FALSE );
add_key( "key-play-pause", KEY_PLAY_PAUSE, NULL, PLAY_PAUSE_KEY_TEXT,
PLAY_PAUSE_KEY_LONGTEXT, VLC_FALSE );
add_key( "key-pause", KEY_PAUSE, NULL, PAUSE_KEY_TEXT,
@@ -2285,7 +2291,8 @@
{ "key-next", ACTIONID_NEXT, 0, 0, 0, 0 },
{ "key-faster", ACTIONID_FASTER, 0, 0, 0, 0 },
{ "key-slower", ACTIONID_SLOWER, 0, 0, 0, 0 },
- { "key-fullscreen", ACTIONID_FULLSCREEN, 0, 0, 0, 0 },
+ { "key-toggle-fullscreen", ACTIONID_TOGGLE_FULLSCREEN, 0, 0, 0, 0 },
+ { "key-leave-fullscreen", ACTIONID_LEAVE_FULLSCREEN, 0, 0, 0, 0 },
{ "key-vol-up", ACTIONID_VOL_UP, 0, 0, 0, 0 },
{ "key-vol-down", ACTIONID_VOL_DOWN, 0, 0, 0, 0 },
{ "key-vol-mute", ACTIONID_VOL_MUTE, 0, 0, 0, 0 },
More information about the vlc-devel
mailing list