Detecting the used keyboard driver

Marvin Raaijmakers marvin.nospam at
Thu Apr 30 11:09:01 PDT 2009

Well a scancode is for the kernel like what a X keycode is to the X
server, and a kernel keycode is for the kernel what a key symbol is to
the X server. So when you change the kernel keycode of a key, then the
X server will receive another kernel keycode from the kernel and as a
result the key will have another X keycode. So an X keycode is not
fixed for a specific key. Furthermore some keys will not have a kernel
keycode by default and such keys won't work under X (because the X
server doesn't receive anything about these keys from the kernel).
Believe me I've thought about this ;)

- Marvin

On Wed, Apr 29, 2009 at 10:26 PM, Matthew Garrett <mjg59 at> wrote:
> On Tue, Apr 28, 2009 at 11:10:57AM +0200, Marvin Raaijmakers wrote:
>> Well I developed keyTouch, a program that allows the user to bind
>> actions to extra function keys (like the Play/Pause, WWW or Zoom keys
>> for example) on a keyboard. KeyTouch is a collection of programs. One
>> program binds a key's scancode to a Linux keycode. So it changes the
>> mapping inside the Linux kernel. Another program is an X client and
>> grabs all key events of the extra function keys. So this program needs
>> to know the X keycodes of the keys and thus it will have to translate
>> the kernel keycode to the X keycode. These translations are different
>> when the evdev input driver is used by the X server instead of the kbd
>> driver.
> This sounds like the wrong way to do it. Why not just ensure that the
> keymap contains the correct keycode->keysym mappings in the first place?
> --
> Matthew Garrett | mjg59 at
> _______________________________________________
> xorg mailing list
> xorg at

More information about the xorg mailing list