[ltp] Remapping Fn-Ctrl keys on Ubuntu Gutsy

John Jason Jordan linux-thinkpad@linux-thinkpad.org
Tue, 30 Oct 2007 12:06:25 -0700


On Tue, 30 Oct 2007 18:56:56 +0000
Richard Neill <rn214@hermes.cam.ac.uk> dijo:

> John Jason Jordan wrote:
> > On Tue, 30 Oct 2007 09:02:30 +0100
> > 
> >> On Mon, 29 Oct 2007, John Jason Jordan wrote:
> >>> I have a T61 that is barely a week old. I want to remap the Fn and Ctrl keys in Ubuntu Gutsy amd64.

> I think that the Fn key is purely a "BIOS thing", and is pretty much 
> never handled by X. (*)
> 
> So I'd expect that you might be able to achieve what you want with some 
> really serious ACPI hacking, but what you are trying to do is equivalent 
> to remapping the power-switch into a control key.
> 
> (*)That said, running xev (x event viwer) and pressing Fn on my T60p, 
> does give a response: keycode 227, whereas I'd have expected nothing to 
> happen. So, you can use xmodmap. Eg:
> 
>    xmodmap -e "keycode 227 = 0x39"
> 
> That makes my machine print '8' every time it receives an 'Fn' press; it 
> also leaves Fn-Home etc working.
> 
> I leave getting it to work with Ctrl as an excercise - I can't figure it 
> out right now!
> 
> Also, note that you'll have to run this command every time you boot (eg 
>  .bashrc), and that xmodmap can really mess up your keyboard while 
> experimenting. I recommend you have a file open from which you can 
> copy-paste characters back into your terminal.

Thanks for that information. I did discover elsewhere that the Fn is
227. However, I don't know enough about Linux to know how to use
xmodmap, although noiw that I know of its existence I will read the man
page and find its home site to see if I can figure it out. So far I
haven't found anyone who has said that they actually got the Fn key
working as a Ctrl key and vice-versa. I'll also check the BIOS just in
case there is a setting in there.