more versatile key handling

This allows us to later add and tweak the keyboard keys used to
navigate the slides and UI.
This commit is contained in:
Chris Cochrun 2023-03-21 10:33:15 -05:00
parent 175b327c5c
commit 554dbc7d29

View file

@ -289,11 +289,26 @@ FocusScope {
id: keyHandler id: keyHandler
/* anchors.fill: parent */ /* anchors.fill: parent */
focus: true focus: true
Keys.onLeftPressed: previousSlideAction() Keys.onPressed: {
Keys.onRightPressed: nextSlideAction() if (event.key == Qt.Key_J)
Keys.onUpPressed: previousSlideAction() nextSlideAction();
Keys.onDownPressed: nextSlideAction() if (event.key == Qt.Key_L)
Keys.onSpacePressed: nextSlideAction() nextSlideAction();
if (event.key == Qt.Key_Right)
nextSlideAction();
if (event.key == Qt.Key_Down)
nextSlideAction();
if (event.key == Qt.Key_K)
previousSlideAction();
if (event.key == Qt.Key_H)
previousSlideAction();
if (event.key == Qt.Key_Up)
previousSlideAction();
if (event.key == Qt.Key_Left)
previousSlideAction();
if (event.key == Qt.Key_P)
SlideObject.playPause();
}
} }
Connections { Connections {