GNOME Bugzilla – Bug 553892
Evince: Scroll back and forward through document pages with back page and forward page keys.
Last modified: 2017-10-05 17:53:34 UTC
On my T40 IBM ThinkPad laptop, there are two keys for scrolling backwards and forwards through pages (usually used in a web browser as the back and forward buttons), located next to the standard 4 arrow keys. Could these back/forward keys please be made to work in evince like the "Next" and "Previous" toolbar buttons currently do? Also if I run "sudo showkey -t 2" to see the keycodes, the result is as follows: # pressing back page key 0x00 0x81 0x9e 0x80 0x81 0x9e # pressing forward page key 0x00 0x81 0x9f 0x80 0x81 0x9f And the result of running "xev" and pressing these two keys (back then forward) is as follows: KeyPress event, serial 30, synthetic NO, window 0x3400001, root 0x58, subw 0x0, time 15955396, (74,77), root:(79,126), state 0x0, keycode 234 (keysym 0x1008ff26, XF86Back), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 30, synthetic NO, window 0x3400001, root 0x58, subw 0x0, time 15955396, (74,77), root:(79,126), state 0x0, keycode 234 (keysym 0x1008ff26, XF86Back), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 30, synthetic NO, window 0x3400001, root 0x58, subw 0x0, time 15965271, (74,77), root:(79,126), state 0x0, keycode 233 (keysym 0x1008ff27, XF86Forward), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 30, synthetic NO, window 0x3400001, root 0x58, subw 0x0, time 15965271, (74,77), root:(79,126), state 0x0, keycode 233 (keysym 0x1008ff27, XF86Forward), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False Other information: DistroRelease: Ubuntu 8.04 ExecutablePath: /usr/bin/evince Package: evince 2.22.2-0ubuntu1 PackageArchitecture: i386 SourcePackage: evince Uname: Linux 2.6.24-19-generic i686
I also wanted to setup this keys for a long time. We just need to bind XF86Forward and back.
Created attachment 124543 [details] [review] Patch for jumping to next/previous page with back/forward keys
Requesting developer review/feedback/comments/check-in please on Michael Kanis' patch, which is attached to comment #2.
We need to bind the keys in EvWindow with GtkUIManager like it's done for other keys, not connect to key-press-event: { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL, G_CALLBACK (ev_window_cmd_edit_find) },
For what it's worth, we recently implemented these for Chromium and have an arguably cleaner patch that uses constants from a header file. http://codereview.chromium.org/140081
Bump. Will this patch make evince listen to the back/forward buttons on my Dell 5-button mouse?
Created attachment 242626 [details] [review] Assign Back/Forward accelerators using GtkUIManager. How about the patch attached? I don't have these keys, can someone please try it?
Review of attachment 242626 [details] [review]: ::: shell/ev-window.c @@ +5879,3 @@ + G_CALLBACK (ev_window_cmd_go_previous_page) }, + { "nextpage", GTK_STOCK_GO_DOWN, "", "XF86Forward", NULL, + G_CALLBACK (ev_window_cmd_go_next_page) }, In principle, that should be "Back/Forward" instead of "XF86Back/Forward", but I think in gtk < 3.9 only the latter works.
Exactly, this is what I've been told by GDK guys.
Christian, so should we push this?
Created attachment 275708 [details] [review] ev-window: Add keybindings for special back/forward keys An updated patch that uses Accelerations instead. I was unsure whether to bind them against page or history. I did the former, although web browser do the later. My gedit (3.4 does not do anything :-/)
Hello: I'm a newbie to Open Source world here. Is this one resolved? I tried Evince 3.18.2 on my ThinkPad T60 running Linux Mint Cinnamon and the two keys in questions did nothing. How does one go about in reviewing the code change? Thanks! -Mike
Created attachment 360845 [details] [review] ev-window: Add keybindings for special back/forward keys Back (former XF86Back) for previous page Forward (former XF86Forward) for next page Update the patch accordingly. Are these keys still a thing? The patch is trivial, but I do not have anything to testing it :-)
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.