You are not logged in.

#1 2008-10-09 10:44:43

Szelek
Member
From: Warsaw
Registered: 2008-09-03
Posts: 86

Getting Super Key to work as FN key.

Hi.
Recently I've bought port replicator II for my Thinkpad T40. When laptop is connected to replicator the lid is closed and I use additional keyboard. I was wondering, do You know how can I change the Super Key (the one with windows logo) to work as a FN key?
Thanks in advance.

Szelek.

Offline

#2 2008-10-09 11:36:33

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: Getting Super Key to work as FN key.

Do you mean to work as one of F1, F2, F3, etc? Or do you mean to work as the FN modifier key, that e.g., combines with the left arrow key to produce Home, and so on. Neither is trivial. The first shouldn't be too much trouble. The second will be a lot more trouble, and depending on your keyboard hardware, you may find yourself unable to fully replicate the FN keys behavior you want.

What you need to do is the same for remapping this key as for any other key. You have to set it up differently for in the Linux Console/Virtual Terminals on the one hand, and in X on the other hand. (Unless you only use one of these.)

For X, read up on xmodmap (manpage and Google it).
For Linux console, the pipeline works like this. You press a key, and that generates a sequence of scancodes. These are reported by "showkey -s". The scancode sequence is then translated into a single keycode/keynumber. This is reported by "showkey -k". Then your keymap file translates that into a keysymbol. You can load your own keymap file using the command "loadmap", and your file can include other files, so it only needs to specify the keycode->keysymbol mappings it wants to overwrite. You can see your current mappings with "dumpkeys" and you can see all possible keysymbols with "dumpkeys -l".

As unwelcome as this may be to hear, I really recommend that you read around a lot about "xmodmap" and "showkey" and "key remapping." I fumbled around with this stuff for months without really understanding it and it was frustrating voodoo that sometimes worked and usually didn't. Once you understand it, though, the voodoo aura will go away.

If there were one or two excellent documentation sites, I'd point you to them, but I haven't found them. I had to learn by reading the man pages closely and reading 20-30 sometimes outdated, usually incomplete, overviews I found by Googling.

Last edited by Profjim (2008-10-09 11:39:09)

Offline

#3 2008-10-09 11:44:04

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: Getting Super Key to work as FN key.

The reason it's not so easy to emulate the Fn modifier key is that on every keyboard I've seen, that's handled in hardware. So Linux doesn't see a fn-left arrow keypress as some modifier key (which you might remap Super to) plus the left arrow key. It sees just the same scancodes as if you had pressed a real home key. If you want to emulate that behavior, you need to  set up Super as a new modifier key, and later down in the chain say that that modifier key + left arrow should be translated into home. And so on for every key that you want Fn to be combined with.

Offline

#4 2008-10-09 11:47:37

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: Getting Super Key to work as FN key.

I have a Thinkpad X61 and the FN key doesn't generate an X event (run 'xev' and then try pressing keys, moving mouse, etc, FN doesn't show up). So I think it would be quite difficult to just remap 'super' as FN. However, there aren't too many shortcuts with FN, so what you can do is to use a prog like 'xbindkeys' (or a standard way to do keyboard shortcuts in you DE) to do the shortcuts with Super do what you want them to do.

Offline

Board footer

Powered by FluxBB