<rdf:Description rdf:about="http://snarfed.org/space/thinkpad%20keys%20in%20firefox">
  <dc:title> thinkpad keys in firefox </dc:title>
  <dc:creator> Ryan Barrett &lt;snarfed at ryanb dot org&gt; </dc:creator>
  <dc:date> 2003-01-01T05:00:00Z </dc:date>
  <dc:language> en </dc:language>
  <dc:format> text/html </dc:format>
  <dc:rights> Copyright 2002-2009 Ryan Barrett </dc:rights>

  <content>
    <p><img src="/space/thinkpad_keys.jpg" alt="/space/thinkpad_keys.jpg" title="" /></p>

<p>I use a <a href="http://www.pc.ibm.com/us/notebooks/thinkpad/t-series/index.html">Thinkpad
T43</a>, and I
love it. Along with other Thinkpads and <a href="http://www-132.ibm.com/webapp/wcs/stores/servlet/ProductDisplay?partNumber=28L3644">IBM
keyboards</a>,
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
<a href="http://mozilla.org/products/firefox/">Firefox</a> (in Linux) out of the box.</p>

<p><strong>Update</strong>: Rob Mayoff's
<a href="http://dqd.com/~mayoff/notes/thinkpad/dqdnavkeys/">howto</a>, originally for
<a href="http://mozilla.org/products/mozilla1.x/">Mozilla</a>, 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, <a href="http://dqd.com/~mayoff/notes/thinkpad/dqdnavkeys/">follow his
howto</a>.</p>

<p>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.)</p>

<p>First, you need to map the keys to X keysyms. There are in-depth instructions
<a href="http://mailman.linux-thinkpad.org/pipermail/linux-thinkpad/2003-December/014440.html">on the linux-thinkpad mailing
list</a>,
but all you need to do is add these two lines to ~/.Xmodmap:</p>

<div class='p-shadow'><pre><code>keycode 234 = F19
keycode 233 = F20
</code></pre></div>

<p><br class='clearing' />and then reload it:</p>

<div class='p-shadow'><pre><code>$ xmodmap ~/.Xmodmap
</code></pre></div>

<p><br class='clearing' />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:</p>

<div class='p-shadow'><pre><code>$ cd firefox/chrome
$ unzip browser.jar
</code></pre></div>

<p><br class='clearing' />Fire up your favorite text editor and open the content/browser/browser.xul file.
In the <strong><keyset id="mainKeyset"></strong> section, find these lines:</p>

<div class='p-shadow'><pre><code>&lt;key id="goBackKb"  keycode="VK_LEFT"
     command="Browser:Back" modifiers="alt"/&gt;
&lt;key id="goForwardKb"  keycode="VK_RIGHT"
     command="Browser:Forward" modifiers="alt"/&gt;
</code></pre></div>

<p><br class='clearing' />...and add these two lines immediately after them:</p>

<div class='p-shadow'><pre><code>&lt;key id="goBackKb"  keycode="VK_F19"
     command="Browser:Back"/&gt;
&lt;key id="goForwardKb"  keycode="VK_F20"
     command="Browser:Forward"/&gt;
</code></pre></div>

<p><br class='clearing' />Repackage browser.jar, like so:</p>

<div class='p-shadow'><pre><code>$ zip -rD0 browser.jar content/browser/
</code></pre></div>

<p><br class='clearing' />If you weren't working in your firefox/chrome directory, copy the new
browser.jar over the existing one in firefox/chrome.</p>

<p>Restart Firefox, and you should be set! If not, feel free to <a href="/space/about">email
me</a>, and I'll try to help.</p>

<p>See also:</p>

<ul>
<li><a href="/space/switch control and caps lock">switch control and caps lock</a></li>
<li><a href="/space/emacs keybindings in firefox">emacs keybindings in firefox</a></li>
<li><a href="/space/change firefox's saved passwords">change firefox's saved passwords</a></li>
<li><a href="/space/control arrow keys in rxvt, tcsh, and emacs">control arrow keys in rxvt, tcsh, and emacs</a></li>
<li><a href="http://tuxmobil.org/ibm.html">TuxMobil's IBM laptop page</a></li>
</ul>

  </content>

  <rdf:Seq>

<rdf:li>
<rdf:Description rdf:about="#1164495255.25">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> thinkpad keys in firefox </dc:title>
  <dc:creator> Ryan </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    thanks to <a href="http://mikebaas.com/">Mike Baas</a> for pointing out some errant slashes left over from the <a href="/space/2006-08-23">migration from snipsnap to pyblosxom</a>. they're fixed now.
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1179892896.95">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> thinkpad keys in firefox </dc:title>
  <dc:creator> aussiebear </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    Hi,<br />
<br />
Just want to say a big THANK YOU for your article.<br />
<br />
I can confirm that this works on my IBM ThinkPad R40 using Arch Linux 2007.05 with Firefox 2.0.0.3 <br />
<br />
Regards. :)
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1180059067.36">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> thinkpad keys in firefox </dc:title>
  <dc:creator> slackhack </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    works on my R40, too. greatly appreciate.
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1181725494.39">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> thinkpad keys in firefox </dc:title>
  <dc:creator> Nightwing </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    Thanks a lot.&nbsp; I've been trying to install Rob Mayoff's fix but have been unsuccessful.&nbsp; However, after a little editing, I'm happily using the keys on my IBM T42 again!
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1193322600.21">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> thinkpad keys in firefox </dc:title>
  <dc:creator> Koen De Jaeger </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    Worked for me on the X61 tablet too.
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1195924887.01">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> thinkpad keys in firefox </dc:title>
  <dc:creator> wilcham </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    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.
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1195925940.2">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> thinkpad keys in firefox </dc:title>
  <dc:creator> wilcham </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    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.
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1198785605.26">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> thinkpad keys in firefox </dc:title>
  <dc:creator> AndyWxy </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    @Wilcham If you know some Chinese you can get your problem done <a href="http://www.linux-wiki.cn/index.php/Firefox%E3%80%81Opera%E4%B8%AD%E4%BD%BF%E7%94%A8Thinkpad%E5%AF%BC%E8%88%AA%E9%94%AE">here</a><br />
<br />
Just copy the followings to replace the original methord of "assign the Back and Forward keys":<br />
<br />
&lt;key id="goBackTabKb" keycode="VK_F19" oncommand="gBrowser.mTabContainer.advanceSelectedTab(-1,true);" /&gt;<br />
&lt;key id="goForwardTabKb" keycode="VK_F20" oncommand="gBrowser.mTabContainer.advanceSelectedTab(1,true);" /&gt;
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1222409427.35">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> thinkpad keys in firefox </dc:title>
  <dc:creator> Sit </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    Skimming through<br />
<a href="http://dev-loki.blogspot.com/2006/04/mapping-unsupported-keys-with-xmodmap.html">http://dev-loki.blogspot.com/2006/04/mapping-unsupported-keys-with-xmodmap.html</a><br />
<br />
I learned that it would work for me just with:<br />
<br />
keycode 233 = XF86Forward<br />
keycode 234 = XF86Back<br />
<br />
But thanks anyway for the lead.
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1229840586.57">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> thinkpad keys in firefox </dc:title>
  <dc:creator> tarocchi </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    also i got a t43p, and it s awesome...thank you for this little trick!
  </content>
</rdf:Description>
</rdf:li>

  </rdf:Seq>
</rdf:Description>
</rdf:RDF>
