Game keys

James Cameron quozl at
Mon Nov 3 03:45:07 EST 2008

On Mon, Nov 03, 2008 at 12:07:30AM -0800, david at wrote:
> I want to find out what the scancodes are, so that I can then document how 
> to get them mapped to keystokes via some mechanism similar to the kernel 
> keymaps (for console stuff) and xkb (for X stuff). the idea being that 
> once these are mapped to be keystrokes, exactly what keystrokes they are 
> mapped to can be tweaked, and things can be configured to take action on 
> those keystrokes.


> the current situation seems to be that the scancodes don't map to 
> anything, the OLPC Sugar build is grabbing and processing the raw 
> scancodes and taking action on them.

Certainly not.  The kernel is receiving scancodes, translating them to
keycodes, X is translating them to keysyms, and Sugar is acting on them.

You can see what the kernel receives with "showkey --scancodes", see
what it translates them to with "showkey", and see what X thinks about
it with "xev".

> how do these codes map to what I read about for dumpkeys/loadkeys 
> (console) or xkb map files (for X)?

scancodes in OFW are the same as scancodes in the kernel, as far as I
can tell.  I ran the OFW and the "showkey --scancodes" command, and
could not find any difference in a quick survey.

Some scancodes have no mapping to keycodes in the kernel on debxo, yet
they have a mapping on the OLPC OS build.  The debxo kernel dutifully
prints out a warning from atkbd.c when it sees a scancode it doesn't
know about:

[  832.249013] atkbd.c: Unknown key pressed (translated set 2, code 0x65 on isa0060/serio0).
[  832.249013] atkbd.c: Use 'setkeycodes 65 <keycode>' to make it known.
[  832.420977] atkbd.c: Unknown key released (translated set 2, code 0x65 on isa0060/serio0).
[  832.420977] atkbd.c: Use 'setkeycodes 65 <keycode>' to make it known.

James Cameron    mailto:quozl at

More information about the Devel mailing list