diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index 05ca1ac..3c6d5a3 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -140,6 +140,7 @@ Controls.Page { function changeServiceItem(index) { const item = serviceItemModel.getItem(index); + currentServiceItem = index; print("index grabbed: " + index); print(item); @@ -213,7 +214,7 @@ Controls.Page { imageEditor.visible = false; presentationEditor.visible = false; presentation.visible = true; - presentation.forceActiveFocus(); + presentation.focusTimer = true; editMode = false; } } else { @@ -223,7 +224,7 @@ Controls.Page { imageEditor.visible = false; presentationEditor.visible = false; presentation.visible = true; - presentation.forceActiveFocus(); + presentation.focusTimer = true; editMode = false; presenting = true; } diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index c9a5fb9..9690970 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -19,6 +19,8 @@ FocusScope { property Item slide: previewSlide + property bool focusTimer: true + Item { id: keyHandler anchors.fill: parent @@ -63,11 +65,6 @@ FocusScope { Controls.ToolSeparator {} Item { Layout.fillWidth: true } Controls.ToolSeparator {} - Controls.ToolButton { - text: "Repeat" - icon.name: "repeat" - onClicked: mainPage.loopVideo() - } Controls.ToolButton { text: "Effects" icon.name: "image-auto-adjust" @@ -161,6 +158,10 @@ FocusScope { visible: itemType === "video"; checked: previewSlide.mpvLoop === "inf" ? true : false onToggled: mainPage.loopVideo() + Keys.onLeftPressed: previousSlideAction() + Keys.onRightPressed: nextSlideAction() + Keys.onUpPressed: previousSlideAction() + Keys.onDownPressed: nextSlideAction() } } @@ -276,8 +277,8 @@ FocusScope { Timer { interval: 500 - running: true - repeat: true + running: false + repeat: focusTimer onTriggered: root.visible ? keyHandler.forceActiveFocus() : null } @@ -300,8 +301,9 @@ FocusScope { } function nextSlideAction() { - root.forceActiveFocus(); - if (currentServiceItem === totalServiceItems) + keyHandler.forceActiveFocus(); + print(currentServiceItem); + if (currentServiceItem === totalServiceItems - 1) return; const nextServiceItemIndex = currentServiceItem + 1; const nextItem = serviceItemModel.getItem(nextServiceItemIndex); @@ -323,7 +325,7 @@ FocusScope { } function previousSlideAction() { - root.forceActiveFocus(); + keyHandler.forceActiveFocus(); if (currentServiceItem === 0) { return; }; diff --git a/src/qml/presenter/ServiceList.qml b/src/qml/presenter/ServiceList.qml index c1b217d..d42f50e 100644 --- a/src/qml/presenter/ServiceList.qml +++ b/src/qml/presenter/ServiceList.qml @@ -246,7 +246,6 @@ Item { onDoubleClicked: { /* showPassiveNotification("Double Clicked") */ /* serviceItemList.currentIndex = index; */ - currentServiceItem = index; changeServiceItem(index); }