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
/* anchors.fill: parent */
focus: true
Keys.onLeftPressed: previousSlideAction()
Keys.onRightPressed: nextSlideAction()
Keys.onUpPressed: previousSlideAction()
Keys.onDownPressed: nextSlideAction()
Keys.onSpacePressed: nextSlideAction()
Keys.onPressed: {
if (event.key == Qt.Key_J)
nextSlideAction();
if (event.key == Qt.Key_L)
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 {