[vlc-commits] hotkeys: handle 360° zoom with mouse wheel
Thomas Guillem
git at videolan.org
Fri Nov 18 10:45:44 CET 2016
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Nov 17 12:06:08 2016 +0100| [5d48ad31e3bec86def868ef1f2bbcb45d01c1c1b] | committer: Thomas Guillem
hotkeys: handle 360° zoom with mouse wheel
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5d48ad31e3bec86def868ef1f2bbcb45d01c1c1b
---
include/vlc_keys.h | 3 +++
modules/control/hotkeys.c | 14 ++++++++++++++
src/config/keys.c | 4 ++--
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/include/vlc_keys.h b/include/vlc_keys.h
index abebaa8..10d1d76 100644
--- a/include/vlc_keys.h
+++ b/include/vlc_keys.h
@@ -234,6 +234,9 @@ typedef enum vlc_action {
ACTIONID_VIEWPOINT_ZOOM_OUT,
ACTIONID_VIEWPOINT_ROLL_CLOCK,
ACTIONID_VIEWPOINT_ROLL_ANTICLOCK,
+ /* Combo Actions */
+ ACTIONID_COMBO_VOL_ZOOM_UP,
+ ACTIONID_COMBO_VOL_ZOOM_DOWN,
} vlc_action_t;
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index 1cdc255..59bfa82 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -328,6 +328,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
vout_thread_t *p_vout, int slider_chan, bool b_vrnav,
int i_action )
{
+#define DO_ACTION(x) PutAction( p_intf, p_input, p_vout, slider_chan, b_vrnav, x)
intf_sys_t *p_sys = p_intf->p_sys;
playlist_t *p_playlist = pl_Get( p_intf );
@@ -1367,6 +1368,19 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
if( p_vout && vout_OSDEpg( p_vout, input_GetItem( p_input ) ) )
DisplayPosition( p_vout, slider_chan, p_input );
break;
+
+ case ACTIONID_COMBO_VOL_ZOOM_UP:
+ if( b_vrnav )
+ DO_ACTION( ACTIONID_VIEWPOINT_ZOOM_IN );
+ else
+ DO_ACTION( ACTIONID_VOL_UP );
+ break;
+ case ACTIONID_COMBO_VOL_ZOOM_DOWN:
+ if( b_vrnav )
+ DO_ACTION( ACTIONID_VIEWPOINT_ZOOM_OUT );
+ else
+ DO_ACTION( ACTIONID_VOL_DOWN );
+ break;
}
return VLC_SUCCESS;
diff --git a/src/config/keys.c b/src/config/keys.c
index 859c0d0..6bfb76f 100644
--- a/src/config/keys.c
+++ b/src/config/keys.c
@@ -452,8 +452,8 @@ static void vlc_AddWheelMapping (void **map, uint32_t kmore, uint32_t kless,
switch (mode)
{
case 0: /* volume up/down */
- amore = ACTIONID_VOL_UP;
- aless = ACTIONID_VOL_DOWN;
+ amore = ACTIONID_COMBO_VOL_ZOOM_UP;
+ aless = ACTIONID_COMBO_VOL_ZOOM_DOWN;
break;
case 2: /* position latter/earlier */
amore = ACTIONID_JUMP_FORWARD_EXTRASHORT;
More information about the vlc-commits
mailing list