[vlc-devel] commit: Qt4: process FSC key event in the main interface (factor code) ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Aug 16 19:27:28 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Aug 16 20:26:45 2009 +0300| [51a66e85dc2b45c83a2304b23e4050d3198a6ca6] | committer: Rémi Denis-Courmont 

Qt4: process FSC key event in the main interface (factor code)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=51a66e85dc2b45c83a2304b23e4050d3198a6ca6
---

 modules/gui/qt4/components/controller.cpp |   11 +----------
 modules/gui/qt4/components/controller.hpp |    3 +++
 modules/gui/qt4/main_interface.cpp        |    2 ++
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index 45418f7..3189d71 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -935,19 +935,10 @@ void FullscreenControllerWidget::leaveEvent( QEvent *event )
 
 /**
  * When you get pressed key, send it to video output
- * FIXME: clearing focus by clearFocus() to not getting
- * key press events didnt work
  */
 void FullscreenControllerWidget::keyPressEvent( QKeyEvent *event )
 {
-    int i_vlck = qtEventToVLCKey( event );
-    if( i_vlck > 0 )
-    {
-        var_SetInteger( p_intf->p_libvlc, "key-pressed", i_vlck );
-        event->accept();
-    }
-    else
-        event->ignore();
+    emit keyPressed( event );
 }
 
 /* */
diff --git a/modules/gui/qt4/components/controller.hpp b/modules/gui/qt4/components/controller.hpp
index cbd010d..9a4933d 100644
--- a/modules/gui/qt4/components/controller.hpp
+++ b/modules/gui/qt4/components/controller.hpp
@@ -229,6 +229,9 @@ public:
     void fullscreenChanged( vout_thread_t *, bool b_fs, int i_timeout );
     void mouseChanged( vout_thread_t *, int i_mousex, int i_mousey );
 
+signals:
+    void keyPressed( QKeyEvent * );
+
 public slots:
     void setVoutList( vout_thread_t **, int );
 
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 72e84d5..b3e5ce6 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -416,6 +416,8 @@ void MainInterface::createMainWidget( QSettings *settings )
     if( config_GetInt( p_intf, "qt-fs-controller" ) )
     {
         fullscreenControls = new FullscreenControllerWidget( p_intf, this );
+        CONNECT( fullscreenControls, keyPressed( QKeyEvent * ),
+                 this, handleKeyPress( QKeyEvent * ) );
     }
 }
 




More information about the vlc-devel mailing list