Monthly Archives: January 2012

Swapping keyboard’s keys

For the second time, an ASUS EEE PC laptop I have started showing keyboard problems. For the first time I replaced the keyboard, with a feeling that the solution would not last long. Well, the problem is back. Some keys (4, w, : and [) stopped working. Certainly they are in the same keyboard scan line/row. I measured the keyboard flat signals and they are fine, so the worst happened: either its a connector problem, solder or a keyboard controller problem.

So, let’s go for the quick and dirty solution (at least works):

The idea is to remap these broken keys to other less used keys. My solution was:

w -> F3
4 -> F4
: -> F5
[ -> F6

I found most answers and solutions to this at, which is, by the way, a great tutorial on this subject.

1. Using another computer, we can check which keycodes are generated by each of these keys using:
$xev | sed -ne ‘/^KeyPress/,/^$/p’

2. Another interesting information shows a graphical keyboard and the corresponding codes:
$xkbprint -label name $DISPLAY >
$gv -orientation=seascape

3. The solution works seamlessly in 3 steps

Step 1: Dump the keyboard map to a file
xkbcomp :0.0 teste.dump

Step 2: Edit the keyboard map
vim teste.dump

Then replace,

= 70;


= 13;

this will replace the function of the key to the function key 4 (F4). Then repeat the same steps for the other keys (look at to check the corresponding keycodes)

Step 3: Load the new keyboard map
xkbcomp teste.dump :0.0

Final step, add this to .xprofile to make it permanent