]> git.sesse.net Git - vlc/commitdiff
skins2: add support for the new key accelerator feature.
authorErwan Tulou <erwan10@videolan.org>
Fri, 11 Jul 2014 15:58:12 +0000 (17:58 +0200)
committerErwan Tulou <erwan10@videolan.org>
Sun, 13 Jul 2014 11:37:38 +0000 (13:37 +0200)
modules/gui/skins2/src/dialogs.cpp
modules/gui/skins2/src/dialogs.hpp
modules/gui/skins2/src/top_window.cpp
modules/gui/skins2/src/vout_manager.hpp
modules/gui/skins2/src/vout_window.cpp
modules/gui/skins2/src/vout_window.hpp

index fc4db08348b56f1f68857234b4eea7c687d01f6f..0067b5764fc79289378ea0f7934cd6a137bb2a5a 100644 (file)
@@ -344,3 +344,12 @@ void Dialogs::showInteraction( interaction_dialog_t *p_dialog )
                                      0, p_arg );
     }
 }
+
+void Dialogs::sendKey( int key )
+{
+    if( m_pProvider && m_pProvider->pf_show_dialog )
+    {
+        m_pProvider->pf_show_dialog( m_pProvider, INTF_DIALOG_SENDKEY,
+                                     key, NULL );
+    }
+}
index 0e3cebfa12670e3181456d490873279f6c14a1e6..a2bb90aa54fac97074450545886c9f5835e17499 100644 (file)
@@ -95,6 +95,9 @@ public:
     /// Show an interaction dialog
     void showInteraction( interaction_dialog_t * );
 
+    /// Send hotkeys (key accelerators)
+    void sendKey( int key );
+
 private:
     // Private because it's a singleton
     Dialogs( intf_thread_t *pIntf );
index d65a80e0acf3be14d01e40a847b4dc2ae3e0533f..e7b79dfac100a656021795612b3971faef55ab3d 100644 (file)
@@ -227,8 +227,7 @@ void TopWindow::processEvent( EvtKey &rEvtKey )
             return;
         }
 
-        var_SetInteger( getIntf()->p_libvlc, "key-pressed",
-                        rEvtKey.getModKey() );
+        getIntf()->p_sys->p_dialogs->sendKey( rEvtKey.getModKey() );
     }
 
     // Always store the modifier, which can be needed for scroll events.
@@ -260,7 +259,7 @@ void TopWindow::processEvent( EvtScroll &rEvtScroll )
         int i = (rEvtScroll.getDirection() == EvtScroll::kUp ?
                  KEY_MOUSEWHEELUP : KEY_MOUSEWHEELDOWN) | m_currModifier;
 
-        var_SetInteger( getIntf()->p_libvlc, "key-pressed", i );
+        getIntf()->p_sys->p_dialogs->sendKey( i );
     }
 }
 
index 6d01ca0a3b38bfcd63ec154a2b5e597b948f6bee..9ddabe8decdbb81fa2854e8edd8c125646a83e85 100644 (file)
@@ -77,8 +77,7 @@ public:
     {
         // Only do the action when the key is down
         if( rEvtKey.getKeyState() == EvtKey::kDown )
-            var_SetInteger( getIntf()->p_libvlc, "key-pressed",
-                             rEvtKey.getModKey() );
+            getIntf()->p_sys->p_dialogs->sendKey( rEvtKey.getModKey() );
     }
 
     virtual void processEvent( EvtScroll &rEvtScroll )
@@ -89,7 +88,7 @@ public:
         i_vlck |= ( rEvtScroll.getDirection() == EvtScroll::kUp ) ?
                   KEY_MOUSEWHEELUP : KEY_MOUSEWHEELDOWN;
 
-        var_SetInteger( getIntf()->p_libvlc, "key-pressed", i_vlck );
+        getIntf()->p_sys->p_dialogs->sendKey( i_vlck );
     }
 
 #endif
index e2093633994f7ed1a6694914bfc31c467e300482..33da4cb97d73152b44af676ded06534836bed469 100644 (file)
@@ -100,7 +100,6 @@ void VoutWindow::processEvent( EvtKey &rEvtKey )
 {
     // Only do the action when the key is down
     if( rEvtKey.getKeyState() == EvtKey::kDown )
-        var_SetInteger( getIntf()->p_libvlc, "key-pressed",
-                         rEvtKey.getModKey() );
+        getIntf()->p_sys->p_dialogs->sendKey( rEvtKey.getModKey() );
 }
 
index bdd2fe62ed2b568d9f4e5267e98f1ca7b9288272..c2f306dc255da99d53b201202ef937934af7013e 100644 (file)
@@ -25,6 +25,7 @@
 #define VOUT_WINDOW_HPP
 
 #include "generic_window.hpp"
+#include "dialogs.hpp"
 #include <vlc_vout_window.h>
 
 class OSGraphics;