After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696836 - Allow to go to next and previous pages pressing arrow keys
Allow to go to next and previous pages pressing arrow keys
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
3.8.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
: 698201 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-03-29 09:46 UTC by Pacho Ramos
Modified: 2013-04-29 19:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tentative patch (1.29 KB, patch)
2013-04-28 23:01 UTC, Alessandro Campagni
needs-work Details | Review
This version checks for modifiers key (1.49 KB, patch)
2013-04-29 18:10 UTC, Alessandro Campagni
committed Details | Review

Description Pacho Ramos 2013-03-29 09:46:51 UTC
Hello

I think would be really useful to be able to go to next and previous pages simply pressing arrow keys instead of always needing to use mouse clicks to achieve that when viewing, for example, a PDF file.

Thanks a lot
Comment 1 Matthias Clasen 2013-04-28 21:29:26 UTC
*** Bug 698201 has been marked as a duplicate of this bug. ***
Comment 2 Alessandro Campagni 2013-04-28 23:01:12 UTC
Created attachment 242757 [details] [review]
tentative patch

Arrows navigation starts a little bit after pressing the keys. However after clicking on the arrow buttons left and right arrow keys work well.
It is the same for Ctrl+PgUP or Ctrl+PgDn already implemented (after a little lag they start working properly).
Comment 3 Cosimo Cecchi 2013-04-29 03:30:06 UTC
Review of attachment 242757 [details] [review]:

Thanks! I have a comment below.

::: src/preview.js
@@ +398,3 @@
+        if (((keyval == Gdk.KEY_Page_Up) &&
+            ((state & Gdk.ModifierType.CONTROL_MASK) != 0)) ||
+            (keyval == Gdk.KEY_Left)) {

This would also "steal" every keybinding that uses Left/Right in combination with Ctrl/Alt/Shift modifiers.
A good way to avoid that is to get all the modifiers supported by the platform with gtk_accelerator_get_default_mod_mask(), and check for (state & default_mod_mask == 0).
Comment 4 Alessandro Campagni 2013-04-29 18:10:06 UTC
Created attachment 242830 [details] [review]
This version checks for modifiers key
Comment 5 Cosimo Cecchi 2013-04-29 18:28:36 UTC
Review of attachment 242830 [details] [review]:

Looks good now, thanks!
Comment 6 Cosimo Cecchi 2013-04-29 19:40:55 UTC
Pushed this to git master now, thanks!