diff --git a/src/qml/Base/HPopup.qml b/src/qml/Base/HPopup.qml index a157b73b..699b3c8b 100644 --- a/src/qml/Base/HPopup.qml +++ b/src/qml/Base/HPopup.qml @@ -5,6 +5,7 @@ Popup { id: popup anchors.centerIn: Overlay.overlay modal: true + focus: true padding: 0 diff --git a/src/qml/Base/HShortcutHandler.qml b/src/qml/Base/HShortcutHandler.qml index b3a4c608..d7855168 100644 --- a/src/qml/Base/HShortcutHandler.qml +++ b/src/qml/Base/HShortcutHandler.qml @@ -6,10 +6,16 @@ Item { Keys.onPressed: { let shortcut = match(event) if (! shortcut) return + + event.accepted = true event.isAutoRepeat ? shortcut.held(event) : shortcut.pressed(event) } Keys.onReleased: { + if (event.isAutoRepeat) return let shortcut = match(event) + if (! shortcut) return + + event.accepted = true if (shortcut && ! event.isAutoRepeat) shortcut.released(event) } diff --git a/src/qml/UI.qml b/src/qml/UI.qml index 47735b12..00cde1e0 100644 --- a/src/qml/UI.qml +++ b/src/qml/UI.qml @@ -8,7 +8,9 @@ import "SidePane" Item { id: mainUI + focus: true Component.onCompleted: window.mainUI = mainUI + Keys.forwardTo: [shortcuts] property alias shortcuts: shortcuts property alias sidePane: sidePane diff --git a/src/qml/Window.qml b/src/qml/Window.qml index 9aa49df9..d1cf618e 100644 --- a/src/qml/Window.qml +++ b/src/qml/Window.qml @@ -49,6 +49,7 @@ ApplicationWindow { asynchronous: false anchors.fill: parent + focus: true scale: py.ready ? 1 : 0.5 source: py.ready ? (Qt.application.arguments[1] || "UI.qml") : ""