Separate keymap for every input device

Sascha Hlusiak saschahlusiak at
Sun Apr 29 21:31:30 PDT 2007

Hi List,

I thought, in the xorg-server-1.3 one can define separate keymaps for each 
input device. 
My input driver initializes the keyboard struct like this:

XkbSetRulesDflts(__XKBDEFRULES__, "pc104", "us", NULL, NULL);
XkbInitKeyboardDeviceStruct (device, &xkbnames, &keySyms, modMap, NULL, NULL);

and generates key events with:
xf86PostKeyboardEvent(dev, scancode, pressed);

keySyms points to my keymap for the scancodes of the device. When I don't have 
a keyboard defined in the xorg.conf, this keymap is used fine, but if there 
is a keyboard defined, the scancodes of my own driver are used with the 
keymap of the keyboard.

Is this a bug? Or is it just not possible? How am I supposed to know the 
scancodes to generate for certain keys? Can I get the current keymap from 
X.Org? How can I generate a "XK_0" from my device drivers point of view?

This would prevent me from attaching two keyboards with different mappings 
(like German and US), right?

Sascha Hlusiak
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the xorg mailing list