Page 1 of 1
forward/back key in emacs
Posted: Sat Jun 25, 2005 6:40 pm
by scotto
Does anyone know what the thinkpad forward/back keys are called in the windows version of emacs? In emacs, you can set key meanings with lisp function calls like this:
(global-set-key [f1] 'fill-paragraph-or-region)
but for the thinkpad web forward/back keys, I can't figure out what to put inside the []'s.
Alternatively, is there a way to _assign_ a symbol to these keys? This is what I've done in Linux and it works great.
Thanks,
Scott
Re: forward/back key in emacs
Posted: Sat Jun 25, 2005 8:18 pm
by roast
scotto wrote:Alternatively, is there a way to _assign_ a symbol to these keys? This is what I've done in Linux and it works great.
How did you do it in linux?
Posted: Sun Jun 26, 2005 12:44 am
by scotto
I used xvm to see what keycodes came out when I pressed forward/back, and then I set their keysyms with xmodmap.
This was a little complicated because I'm using Fedora Core 2 Gnome, which overrides these settings. The solution was to make a script that ran before Gnome started. Here' the "script," which I called "mapTPkeysyms:
#!/bin/sh
xmodmap -e 'keycode 233=F20'
xmodmap -e 'keycode 234=F19'
Then, I configured Fedora Core 2 gnome to run it at startup:
* FC2 main menu -> preferences -> sessions -> startup programs --> add
* add <full path to script>/mapTPkeysyms
With the forward backward keys mapped to F19 and F20, you can then configure Firefox to use them the same way that it does in Windows:
cd /usr/lib/firefox-<version>/chrome
unzip browser.jar
emacs content/browser/browser.xul
search for
<keyset id="mainKeyset">
and right after the lines below:
<key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/>
<key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/>
add these two lines:
<key id="goBackKb" keycode="VK_F19" command="Browser:Back"/>
<key id="goForwardKb" keycode="VK_F20" command="Browser:Forward"/>
then
zip -rD0 browser.jar content/browser/
Posted: Sun Jun 26, 2005 12:53 am
by roast
Wow, this was really helpful. Thanks! I'll try this when I get back to school tomorrow.
I agree, this would be a very useful thing to have on win emacs.