hotkeys: handle 360° zoom with mouse wheel
authorThomas Guillem <thomas@gllm.fr>
Thu, 17 Nov 2016 11:06:08 +0000 (12:06 +0100)
committerThomas Guillem <thomas@gllm.fr>
Fri, 18 Nov 2016 09:45:39 +0000 (10:45 +0100)
include/vlc_keys.h
modules/control/hotkeys.c
src/config/keys.c

index abebaa8..10d1d76 100644 (file)
@@ -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;
 
index 1cdc255..59bfa82 100644 (file)
@@ -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;
index 859c0d0..6bfb76f 100644 (file)
@@ -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;