off by one for 2007 September 22 (entry 0)

< cool screen tricks
speed versus throughput >

[Trackback URL for this entry] Sat Sep 22 15:36:03 PST firefox forwards and backwards navigation:

Thinkpad laptops have two special "forward" and "backward" keys above the typical left and right keys that are used for paging in applications like Firefox and other web browsers. Unfortunately, they don't work out of the box in Ubuntu like other buttons (like the volume knobs, suspend, etc.). I hate using Alt-Left/Right -- why make two keystrokes when I should be able to use one?

So I have been looking for a solution, but complicating this issue is that old solutions to this problem don't work in Firefox +v2.0, firefox extensions that advertise this ability are pre 2.0 as well, and Firefox remote tricks assigned to commands don't seem to work either (I think because of a vulnerability in Firefox remote? I'm not sure.)

Anyway, this site has a working howto, and it's really easy. The short version is to edit your ~/.Xmodmap to make back (keycode 234) and forwards (keycode 233) F19 and F20, and then edit browser.xul to use that instead of the Alt-Arrow combos. For Ubuntu anyway one thing different from the howto is that browser.xul is already unzipped in /usr/share/firefox/chrome/ ... etc, not in your homedir or .mozilla, etc. Just edit it and save it; you don't need to re-package chrome or whatever although you do need to restart Firefox. This material should get updated in the ThinkWiki and other sites... but I'm not going to do it.

Incidentally, the "back" and "forward" buttons on the new Microsoft Natural Ergonomic Keyboard 4000 use the same keycodes, so if you have one attached to your Thinkpad like me, this is a two-for-one deal.

Update: You can leave the old hotkeys in and just add the new ones to keep the old "alt-arrow" mapping and add the new thinkpad arrows if you want! Beaujolais!

Filed under: technical:hack


[Main]

Unless otherwise noted, all content licensed by Peter A. H. Peterson
under a Creative Commons License.