forward/back key in emacs

Performance, hardware, software, general buying and gaming discussion..
Post Reply
Message
Author
scotto
Posts: 10
Joined: Thu Jul 01, 2004 12:13 pm

forward/back key in emacs

#1 Post by scotto » Sat Jun 25, 2005 6:40 pm

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

roast
Sophomore Member
Posts: 140
Joined: Sat May 28, 2005 6:13 pm

Re: forward/back key in emacs

#2 Post by roast » Sat Jun 25, 2005 8:18 pm

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?

scotto
Posts: 10
Joined: Thu Jul 01, 2004 12:13 pm

#3 Post by scotto » Sun Jun 26, 2005 12:44 am

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/

roast
Sophomore Member
Posts: 140
Joined: Sat May 28, 2005 6:13 pm

#4 Post by roast » Sun Jun 26, 2005 12:53 am

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.

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Thinkpad - General HARDWARE/SOFTWARE questions”

Who is online

Users browsing this forum: No registered users and 7 guests