[vlc-commits] qml: add defaultKeyReleaseAction to NavigableFocusScope

Pierre Lamot git at videolan.org
Tue Nov 19 16:49:58 CET 2019


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Oct 28 14:44:00 2019 +0100| [5438fe1edf924ca0ac95306e67e93ea5c5d94a25] | committer: Jean-Baptiste Kempf

qml: add defaultKeyReleaseAction to NavigableFocusScope

  it  will accept the matching keys from the ones handled in
  defaultKeyAction.

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

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

 modules/gui/qt/qml/utils/NavigableFocusScope.qml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/modules/gui/qt/qml/utils/NavigableFocusScope.qml b/modules/gui/qt/qml/utils/NavigableFocusScope.qml
index d811927cd7..6929eebf93 100644
--- a/modules/gui/qt/qml/utils/NavigableFocusScope.qml
+++ b/modules/gui/qt/qml/utils/NavigableFocusScope.qml
@@ -150,4 +150,18 @@ FocusScope {
             navigationCancel( index )
         }
     }
+
+    function defaultKeyReleaseAction(event, index) {
+        if (event.accepted)
+            return
+
+        if ( KeyHelper.matchLeft(event)
+                || KeyHelper.matchRight(event)
+                || KeyHelper.matchUp(event)
+                || KeyHelper.matchDown(event)
+                || KeyHelper.matchCancel(event) )
+        {
+            event.accepted = true
+        }
+    }
 }



More information about the vlc-commits mailing list