[vlc-devel] [PATCH 07/10] qml: add defaultKeyReleaseAction to NavigableFocusScope

Pierre Lamot pierre at videolabs.io
Mon Nov 18 18:14:10 CET 2019


  it  will accept the matching keys from the ones handled in
  defaultKeyAction.
---
 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
+        }
+    }
 }
-- 
2.17.1



More information about the vlc-devel mailing list