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 )
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:
/// 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 );
......
......@@ -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 );
}
}
......
......@@ -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
......
......@@ -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() );
}
......@@ -25,6 +25,7 @@
#define VOUT_WINDOW_HPP
#include "generic_window.hpp"
#include "dialogs.hpp"
#include <vlc_vout_window.h>
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