[vlc-commits] qml: pass modifiers along with key for hotkeys

Pierre Lamot git at videolan.org
Mon Oct 14 11:58:55 CEST 2019


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Sep 16 17:05:38 2019 +0200| [e14a7402d9bb20a03fc28c279efa36cd45cd81f0] | committer: Jean-Baptiste Kempf

qml: pass modifiers along with key for hotkeys

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt/main_interface.cpp        | 4 ++--
 modules/gui/qt/main_interface.hpp        | 2 +-
 modules/gui/qt/qml/player/MiniPlayer.qml | 2 +-
 modules/gui/qt/qml/player/Player.qml     | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index e9bf16938f..8f87d26c85 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -322,9 +322,9 @@ void MainInterface::onInputChanged( bool hasInput )
 #ifdef KeyPress
 #undef KeyPress
 #endif
-void MainInterface::sendHotkey( Qt::Key key )
+void MainInterface::sendHotkey(Qt::Key key , Qt::KeyboardModifiers modifiers)
 {
-    QKeyEvent event(QEvent::KeyPress, key, Qt::NoModifier);
+    QKeyEvent event(QEvent::KeyPress, key, modifiers );
     int vlckey = qtEventToVLCKey(&event);
     var_SetInteger(vlc_object_instance(p_intf), "key-pressed", vlckey);
 }
diff --git a/modules/gui/qt/main_interface.hpp b/modules/gui/qt/main_interface.hpp
index fac9fe102b..e9a3e6d512 100644
--- a/modules/gui/qt/main_interface.hpp
+++ b/modules/gui/qt/main_interface.hpp
@@ -238,7 +238,7 @@ protected slots:
     void setFullScreen( bool );
     void onInputChanged( bool );
 
-    void sendHotkey( Qt::Key key );
+    void sendHotkey(Qt::Key key, Qt::KeyboardModifiers modifiers );
 
 signals:
     void askGetVideo( bool );
diff --git a/modules/gui/qt/qml/player/MiniPlayer.qml b/modules/gui/qt/qml/player/MiniPlayer.qml
index 585c7b0de6..7c5f6d1572 100644
--- a/modules/gui/qt/qml/player/MiniPlayer.qml
+++ b/modules/gui/qt/qml/player/MiniPlayer.qml
@@ -164,7 +164,7 @@ Utils.NavigableFocusScope {
             if (!event.accepted)
                 defaultKeyAction(event, 0)
             if (!event.accepted)
-                rootWindow.sendHotkey(event.key);
+                rootWindow.sendHotkey(event.key, event.modifiers);
         }
 
     }
diff --git a/modules/gui/qt/qml/player/Player.qml b/modules/gui/qt/qml/player/Player.qml
index 7e863847df..45c8da989b 100644
--- a/modules/gui/qt/qml/player/Player.qml
+++ b/modules/gui/qt/qml/player/Player.qml
@@ -168,7 +168,7 @@ Utils.NavigableFocusScope {
                 if (event.key === Qt.Key_Menu) {
                     toolbarAutoHide.toggleForceVisible()
                 } else {
-                    rootWindow.sendHotkey(event.key);
+                    rootWindow.sendHotkey(event.key, event.modifiers);
                 }
             }
         }
@@ -269,7 +269,7 @@ Utils.NavigableFocusScope {
                         if (event.key === Qt.Key_Menu)
                             toolbarAutoHide.toggleForceVisible()
                         else
-                            rootWindow.sendHotkey(event.key);
+                            rootWindow.sendHotkey(event.key, event.modifiers);
                     }
                 }
             }



More information about the vlc-commits mailing list