Commit 74c73be3 authored by Erwan Tulou's avatar Erwan Tulou

skins2: add support for the new key accelerator feature.

parent 01f2d198
...@@ -344,3 +344,12 @@ void Dialogs::showInteraction( interaction_dialog_t *p_dialog ) ...@@ -344,3 +344,12 @@ void Dialogs::showInteraction( interaction_dialog_t *p_dialog )
0, p_arg ); 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 );
}
}
...@@ -95,6 +95,9 @@ public: ...@@ -95,6 +95,9 @@ public:
/// Show an interaction dialog /// Show an interaction dialog
void showInteraction( interaction_dialog_t * ); void showInteraction( interaction_dialog_t * );
/// Send hotkeys (key accelerators)
void sendKey( int key );
private: private:
// Private because it's a singleton // Private because it's a singleton
Dialogs( intf_thread_t *pIntf ); Dialogs( intf_thread_t *pIntf );
......
...@@ -227,8 +227,7 @@ void TopWindow::processEvent( EvtKey &rEvtKey ) ...@@ -227,8 +227,7 @@ void TopWindow::processEvent( EvtKey &rEvtKey )
return; return;
} }
var_SetInteger( getIntf()->p_libvlc, "key-pressed", getIntf()->p_sys->p_dialogs->sendKey( rEvtKey.getModKey() );
rEvtKey.getModKey() );
} }
// Always store the modifier, which can be needed for scroll events. // Always store the modifier, which can be needed for scroll events.
...@@ -260,7 +259,7 @@ void TopWindow::processEvent( EvtScroll &rEvtScroll ) ...@@ -260,7 +259,7 @@ void TopWindow::processEvent( EvtScroll &rEvtScroll )
int i = (rEvtScroll.getDirection() == EvtScroll::kUp ? int i = (rEvtScroll.getDirection() == EvtScroll::kUp ?
KEY_MOUSEWHEELUP : KEY_MOUSEWHEELDOWN) | m_currModifier; KEY_MOUSEWHEELUP : KEY_MOUSEWHEELDOWN) | m_currModifier;
var_SetInteger( getIntf()->p_libvlc, "key-pressed", i ); getIntf()->p_sys->p_dialogs->sendKey( i );
} }
} }
......
...@@ -77,8 +77,7 @@ public: ...@@ -77,8 +77,7 @@ public:
{ {
// Only do the action when the key is down // Only do the action when the key is down
if( rEvtKey.getKeyState() == EvtKey::kDown ) if( rEvtKey.getKeyState() == EvtKey::kDown )
var_SetInteger( getIntf()->p_libvlc, "key-pressed", getIntf()->p_sys->p_dialogs->sendKey( rEvtKey.getModKey() );
rEvtKey.getModKey() );
} }
virtual void processEvent( EvtScroll &rEvtScroll ) virtual void processEvent( EvtScroll &rEvtScroll )
...@@ -89,7 +88,7 @@ public: ...@@ -89,7 +88,7 @@ public:
i_vlck |= ( rEvtScroll.getDirection() == EvtScroll::kUp ) ? i_vlck |= ( rEvtScroll.getDirection() == EvtScroll::kUp ) ?
KEY_MOUSEWHEELUP : KEY_MOUSEWHEELDOWN; KEY_MOUSEWHEELUP : KEY_MOUSEWHEELDOWN;
var_SetInteger( getIntf()->p_libvlc, "key-pressed", i_vlck ); getIntf()->p_sys->p_dialogs->sendKey( i_vlck );
} }
#endif #endif
......
...@@ -100,7 +100,6 @@ void VoutWindow::processEvent( EvtKey &rEvtKey ) ...@@ -100,7 +100,6 @@ void VoutWindow::processEvent( EvtKey &rEvtKey )
{ {
// Only do the action when the key is down // Only do the action when the key is down
if( rEvtKey.getKeyState() == EvtKey::kDown ) if( rEvtKey.getKeyState() == EvtKey::kDown )
var_SetInteger( getIntf()->p_libvlc, "key-pressed", getIntf()->p_sys->p_dialogs->sendKey( rEvtKey.getModKey() );
rEvtKey.getModKey() );
} }
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#define VOUT_WINDOW_HPP #define VOUT_WINDOW_HPP
#include "generic_window.hpp" #include "generic_window.hpp"
#include "dialogs.hpp"
#include <vlc_vout_window.h> #include <vlc_vout_window.h>
class OSGraphics; class OSGraphics;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment