Using IBM Keyboard Navigation Keys in Linux Mozilla and Firefox

by Rob Mayoff
Note: I have switched to a Powerbook running MacOS X, so I no longer use or maintain this package. I am aware that it does not work in Firefox 1.5, but I don't know why and I'm not going to investigate. If you get it working in Firefox 1.5, let me know and I'll be glad to update this page.

Let me point out again: THIS PACKAGE DOES NOT WORK IN FIREFOX 1.5 (or later versions). I don't use this package any more, so I'm not going to try to fix it.

Introduction

IBM has produced various keyboards that have extra, non-standard “navigation keys”[Click here for pictures.] . For example, my Thinkpad A30p has eight: six round keys down the left side of the keyboard and forward/back keys around the up-arrow key. My IBM Space Saver keyboard has just the forward/back keys. The newer “USB Keyboard with UltraNav"” also has the page forward/back keys.

In Internet Explorer on Windows, the page left/right keys act as Back and Forward navigation keys. On Linux, by default, they do nothing.

To make these keys work in Mozilla or Firefox[I learned how to support Firefox from this page by Ryan Barrett.] on Linux, we need to assign “keysyms” to the keys (so that the browser can tell when the keys are pressed), and then tell the browser what to do when the keys are pressed.

Assigning the Keysyms (on Red Hat systems)

To assign the keysyms to the keys, we use a program called xmodmap. The following instructions are for Red Hat Linux 6.2 and later systems (through Fedora Core 1). Create a file named $HOME/.Xmodmap containing these lines:

! Email
keycode 236 = F13
! Home
keycode 178 = F14
! Find
keycode 229 = F15
! Bookmark
keycode 230 = F16
! Reload
keycode 231 = F17
! Stop
keycode 232 = F18
! Page left
keycode 234 = F19
! Page right
keycode 233 = F20

Now run “xmodmap ~/.Xmodmap” (or log out and log back in).

It appears that Gnome 2.6 (part of Fedora Core 2) broke backward-compatibility by ignoring the .Xmodmap file. (Idiotic, no?) So if you are running Gnome 2.6, you need to manually load the .Xmodmap file each time you start X or wake up a sleeping notebook. I'm still pondering what to do about this.

Telling the Browser What To Do

I have created an “XPI” (cross-platform installer) for Mozilla and Firefox that configures them as follows:

Key Action
Back Page Back
Forward Page Forward
Email Mozilla: Send Page; Firefox: New Message
Home Go to Home Page
Find Find in Page
Control + Find Firefox only: Web Search
Bookmark Add Bookmark As...
Reload Reload Page (ignoring cache with Shift or Control)
Stop Stop Loading

All you need to do is click this link to run the installer, decide that you trust me[You have to trust me because XPIs have access to all of your files. Don't worry, I'm not trying to crack your system.], and click the “Install” button. Mozilla should report success almost instantly. Firefox won't mention success (but will mention failure). Quit and restart the browser for the changes to take effect.

Troubleshooting

If the XPI installation was successful but the keys don't work, the most likely problem is that you are running the tpb program and that it is intercepting some or all of the navigation keys, so that Mozilla (or Firefox) doesn't know when you press them. I have never run tpb, but I believe that you can tell tpb not to grab any keys by adding this line to files /etc/tpbrc and $HOME/.tpbrc:

XEVENTS OFF

After adding this line, you will need to restart tpb. How you do that depends on how tpb got run in the first place. On some systems, you can run service tpb restart. On some, you can log out and log back in. Rebooting your computer is a sure-fire method but probably overkill.

If you experience any problems with the installer, you have my apologies, but as I said at the top of the page, I don't use or maintain this package any more, so you're out of luck.

This work was inspired by a message from Jacob Hoffman-Andrews to the linux-thinkpad mailing list.

History