Detecting the used keyboard driver

Marvin Raaijmakers marvin.nospam at gmail.com
Tue Apr 28 02:10:57 PDT 2009


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.
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.

Regards,
Marvin Raaijmakers

On Tue, Apr 28, 2009 at 2:31 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> On Mon, Apr 27, 2009 at 09:15:22PM +0200, Marvin Raaijmakers wrote:
>> Is there a way to detect, from the host that runs the X clients, what
>> keyboard driver is used by the X server? I want to know this because I
>> want to write a program that should behave differently when the evdev
>> driver is used instead of the traditional keyboard driver.
>
> Not really, but you can query the keyboards for all properties. If a bunch of
> evdev properties are present, then it's probably running the kbd driver.
>
> May I ask what the actual problem is you're trying to solve?
>
> Cheers,
>  Peter
>



More information about the xorg mailing list