I use a Thinkpad T43, and I love it. Along with other Thinkpads and IBM keyboards, it has a couple little keys above the arrow keys that go “back” and “forward” in your browser. At least, in Windows IE. Shockingly, they don’t work with Firefox (in Linux) out of the box.
Update: Rob Mayoff’s howto, originally for Mozilla, now includes Firefox. He’s done most of the work in a package that you can install with a single click. If you just want your thinkpad keys to work already, follow his howto.
Otherwise, here’s the recipe for Firefox, versions 0.8 through 2.x. (It probably works with earlier and later versions too, but no guarantees.)
First, you need to map the keys to X keysyms. There are in-depth instructions on the linux-thinkpad mailing list, but all you need to do is add these two lines to ~/.Xmodmap:
keycode 234 = F19
keycode 233 = F20
and then reload it:
$ xmodmap ~/.Xmodmap
Now, you need to perform surgery on one of the jar files that Firefox uses to configure itself. In the chrome/ subdirectory of your Firefox directory, unpack the browser.jar file like so:
$ cd firefox/chrome
$ unzip browser.jar
Fire up your favorite text editor and open the content/browser/browser.xul file.
In the
<key id="goBackKb" keycode="VK_LEFT"
command="Browser:Back" modifiers="alt"/>
<key id="goForwardKb" keycode="VK_RIGHT"
command="Browser:Forward" modifiers="alt"/>
…and add these two lines immediately after them:
<key id="goBackKb" keycode="VK_F19"
command="Browser:Back"/>
<key id="goForwardKb" keycode="VK_F20"
command="Browser:Forward"/>
Repackage browser.jar, like so:
$ zip -rD0 browser.jar content/browser/
If you weren’t working in your firefox/chrome directory, copy the new browser.jar over the existing one in firefox/chrome.
Restart Firefox, and you should be set! If not, feel free to email me, and I’ll try to help.
thanks to Mike Baas for pointing out some errant slashes left over from the migration from snipsnap to pyblosxom. they’re fixed now.
Hi,
Just want to say a big THANK YOU for your article.
I can confirm that this works on my IBM ThinkPad R40 using Arch Linux 2007.05 with Firefox 2.0.0.3
Regards. :)
works on my R40, too. greatly appreciate.
Thanks a lot. I’ve been trying to install Rob Mayoff’s fix but have been unsuccessful. However, after a little editing, I’m happily using the keys on my IBM T42 again!
Worked for me on the X61 tablet too.
I know this is propably not the best place to ask, but maybe someone knows how to (in Firefox running under winxp) reassign the Back and Forward keys to Previous Tab and Next Tab? I tried keyconfig extension but it doesn’t catch the keys. Right now I have assigned Ctrl+Alt+L/R-arrows and it works but the special Thinkpad keys would’ve been more useful to me, because I surf using tabs, and rarely use Back and almost never Forward.
I know this is propably not the best place to ask, but maybe someone knows how to (in Firefox running under winxp) reassign the Back and Forward keys to Previous Tab and Next Tab? I tried keyconfig extension but it doesn’t catch the keys. Right now I have assigned Ctrl+Alt+L/R-arrows and it works but the special Thinkpad keys would’ve been more useful to me, because I surf using tabs, and rarely use Back and almost never Forward.
@Wilcham If you know some Chinese you can get your problem done here
Just copy the followings to replace the original methord of “assign the Back and Forward keys”:
<key id=”goBackTabKb” keycode=”VK_F19″ oncommand=”gBrowser.mTabContainer.advanceSelectedTab(-1,true);” />
<key id=”goForwardTabKb” keycode=”VK_F20″ oncommand=”gBrowser.mTabContainer.advanceSelectedTab(1,true);” />
Skimming through
http://dev-loki.blogspot.com/2006/04/mapping-unsupported-keys-with-xmodmap.html
I learned that it would work for me just with:
keycode 233 = XF86Forward
keycode 234 = XF86Back
But thanks anyway for the lead.
also i got a t43p, and it s awesome…thank you for this little trick!
nice to meet you,perfect comp,but i havnot found users manual yet,
I still have a few keys and buttons on my Thinkpad X220-tablet that are not operational under Linux but that work well under that other OS. I’ve heard that there is a low-level register when one might mask bits to enable-disable various keys and buttons and ACPI features. Can you shed any light on this? Can you direct me to where I might find more information — without reading the kernel code?
Thanks in advance,
~~~ 0;-Dan
Austin, TX USA