From 9fc256d43aeb06684935805a057d04e6f401e052 Mon Sep 17 00:00:00 2001 From: Stefan Wallentowitz Date: Mon, 1 Jul 2019 21:28:06 +0200 Subject: [PATCH] Left and right key for page navigation in presentation mode As the presentation remotes use the left and right keys for page/slide navigation, map them to previous and next page in presentation mode. It still preserves the Shift+Left/Right combination in dual page view. It only masks out the relative scrolling which is not needed in presentation mode, so thats okay. --- src/gui/XournalView.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gui/XournalView.cpp b/src/gui/XournalView.cpp index 1fb53c1c..944fa8dd 100644 --- a/src/gui/XournalView.cpp +++ b/src/gui/XournalView.cpp @@ -318,7 +318,14 @@ bool XournalView::onKeyPressEvent(GdkEventKey* event) } else { - layout->scrollRelative(-scrollKeySize, 0); + if (control->getSettings()->isPresentationMode()) + { + control->getScrollHandler()->goToPreviousPage(); + } + else + { + layout->scrollRelative(-scrollKeySize, 0); + } } return true; } @@ -331,7 +338,14 @@ bool XournalView::onKeyPressEvent(GdkEventKey* event) } else { - layout->scrollRelative(scrollKeySize, 0); + if (control->getSettings()->isPresentationMode()) + { + control->getScrollHandler()->goToNextPage(); + } + else + { + layout->scrollRelative(scrollKeySize, 0); + } } return true; }