Separate keymap for every input device

Daniel Stone daniel at fooishbar.org
Sun Apr 29 21:52:40 PDT 2007


On Mon, Apr 30, 2007 at 12:31:30AM -0400, Sascha Hlusiak wrote:
> 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.

Rather than manually building a keysym map, you're much better off
writing an XKB layout for your device.  It's not too hard, promise.

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

Right now, that is indeed the case.  This is fixed in 1.4 (the master
branch in git).

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20070430/fc290033/attachment.pgp>


More information about the xorg mailing list