Mapping keys : unfucking one keyboard at a time

So the “unfuck my keyboard” project is going well. We now have a way to map scancodes to keycodes even for the vendors that choose non-standard scancodes that don't get input events.

The thinkpad-acpi and sony-laptop kernel drivers now also support the setkeycode ioctl and report key presses over input. This means we can map the acpi events to keys, even when vendors do crazy things and move the decal on the button between models and ranges for no apparent reason.


So now I need your help.

Do you get something similar to this in dmesg?:

atkbd.c: Unknown key pressed (translated set 2, code 0x97 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e017 ' to make it known.

Try using all the fn-buttons and the special multimedia buttons, you might find you could help make this work.


I need to know what button does what on your laptop. You can already see I've fixed Bastiens laptop by looking at this file. This gives you an idea how simple it is.


I also need to know what mapping you have. See this file and send me a patch to make it “just work” for you in the future.

Big Note:

You'll need to be using a very new HAL and hal-info to make this work right now. If you want the sony and thinkpad bits to work you'll also need kernel modules from git. Actually getting it working now is unimportant – getting the data as soon as possible makes sure it should work for as many people as possible for Fedora 8, or the next version of Ubuntu or Suse.

So please, visit the quirk site and help me try to fix broken keys by sending patches. I need your help.

Published by


Richard has over 10 years of experience developing open source software. He is the maintainer of GNOME Software, PackageKit, GNOME Packagekit, GNOME Power Manager, GNOME Color Manager, colord, and UPower and also contributes to many other projects and opensource standards. Richard has three main areas of interest on the free desktop, color management, package management, and power management. Richard graduated a few years ago from the University of Surrey with a Masters in Electronics Engineering. He now works for Red Hat in the desktop group, and also manages a company selling open source calibration equipment. Richard's outside interests include taking photos and eating good food.

One thought on “Mapping keys : unfucking one keyboard at a time”

  1. Can you give some info on how new the hal/hal-info should/must be? If someone is running F7 or Ubuntu 7.04, would that be enough? Would you be able to get usable information if you got those “atkbd.c: …” and the details of the laptop, for people that do not have a recent HAL/hal-info? (assuming people are happy to help but do not mind if their system will not be fixed yet).

Comments are closed.