]> git.sesse.net Git - vlc/commitdiff
Qt4: process FSC key event in the main interface (factor code)
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 16 Aug 2009 17:26:45 +0000 (20:26 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 16 Aug 2009 17:27:24 +0000 (20:27 +0300)
modules/gui/qt4/components/controller.cpp
modules/gui/qt4/components/controller.hpp
modules/gui/qt4/main_interface.cpp

index 45418f7dcac27ed34ac5b09c09ea23d47bc49549..3189d719e835de323c08866ee3dae65c329aae90 100644 (file)
@@ -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 );
 }
 
 /* */
index cbd010d83ac8e1a90d25e23b8382414168b47b08..9a4933d48d645ab5cfdd30246f34bb3ba11a5675 100644 (file)
@@ -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 );
 
index 72e84d511378d0b045924f33389d8436c6985975..b3e5ce638d47da755e8168260449395330f0a017 100644 (file)
@@ -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 * ) );
     }
 }