Detecting the used keyboard driver

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 28 15:14:43 PDT 2009


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 X client is doing the wrong thing. It should get the
mapping from the server and then bind to the correct keysym.
The only thing a keycode tells you is that it is the e.g. 5th key in the
second row. And even that you have to guess.

> What do you mean by "query the keyboards for all properties"? Using
> XListInputDevices? Then there need to be different values for
> min_keycode, max_keycode or num_keys (or am I wrong?). These are
> however the same for evdev and kbd.

XListDeviceProperties()

Cheers,
  Peter



More information about the xorg mailing list