I am using a keyboard with the Fn key. This is on a laptop.
So my Fn + Up/Down/Left/Right keys are mapped to brightness/volume. I would much rather them be mounted to Page Up/Page Down and Home/End. And map the other 4 keys to these 2. The page Page Up/Page Down has Fn + them for Home/End. Its a shitty keyboard layout but I want to make it work.
Anyone knows how to figure out what the keycodes are and how to remap them?
Version: 10.04 x32
So here are some experiments:
Using xmodmap -pke I discovered that keycodes 122 = vol down, 123 = vol up. And I got all the info for Home/End/Page Up (next), Page Down (prior).
Now when using the vol up keys, there are no events being fired that xev
can detect.
I can remap the volume keys to XF86AudioLowerVolume
or XF86AudioRaiseVolume
, but once I map those two to Home/End (respectively) they don't do anything. xev
still does not pick up these events after a remap.
Remap: xmodmap -e "keycode 122 = Home"
Some laptop Fn key combinations are multimedia keys (appearing to the OS as ordinary keys with nonstandard codes), while others trigger ACPI events that eventually reach the OS, and some are just handled by the BIOS and never seen by the OS. The information paths are explained on the Hotkeys/Architecture page on the Ubuntu wiki, complete with diagrams.
The KeyTouch program should handle anything that is seen by the OS, and has a friendly GUI for describing your model and configuring what the keys should do (install the
keytouch-editor
package as well askeytouch
).If the OS can't see anything when you press the brightness keys, it could be because they're handled directly by the BIOS. The battle is not completely lost — it is in principle possible to hack the BIOS — but the difficulty level is considerably raised.
There is a program called xev that does what you require. I liked the tutorial on setting it up.
The Fn key combinations is not defined in software and can therefor not be redefined, so you need a soldering iron and some electronics knowhow!