per-keyboard user-defined X keymap and keyboard behaviour

Peter Hutterer peter.hutterer at who-t.net
Thu Jan 7 19:08:22 PST 2010


On Fri, Jan 08, 2010 at 08:35:07AM +1300, martin f krafft wrote:
> Hello folks,
> 
> I often use my Thinkpad with an external keyboard. When I plug in
> the keyboard, it is initialised according to HAL with standard
> symbols. While I load a custom keymap from Xsession [0] and also
> call `xset r rate …` there, these settings do not take effect once
> I plug in the external keyboard — while the internal keyboard works
> exactly according to my keymap and rate settings, the external one
> uses defaults for both, probably because xset/xkbcomp only affect
> existing devices, not the defaults.
> 
> 0. http://madduck.net/docs/extending-xkb
> 
> I seek a way to address this and have a few questions. I would
> greatly appreciate all kinds of feedback.
> 
> 1. I would prefer not to install my custom keymaps into /usr/lib, as
>    that area of the filesystem is vendor-domain. However, I have not
>    found a way to tell Xorg to look in other places too for xkb
>    files.
> 
>    Is it possible to extend the XKEYBOARD search path, such that
>    I could reference custom symbol tables from HAL's
>    input.xkb.options property of a keyboard?

xkbcomp supports -I, but the xserver doesn't provide an option to set a
custom include path. so your best bet is to run xkbcomp at runtime for xkb
files outside the default paths.

> 2. Is it possible to initialise delay and repeat rate of external
>    keyboards to custom values (I run `xset r rate 255 47`)?

xset only works on core protocol requests. the core protocol however doesn't
provide device specifiers and to change the keyboard repeat rate you'd have
to use an xkb-aware tool. if there is one, I don't know, never needed that.

> 3. If (1) or (2) are not possible, then what else could I do? Is
>    there a way to subscribe to Xorg in such a way that it informs me
>    (or calls back) upon configuration of a new input device, such
>    that I can relaod the keymap with xkbcomp and reset the
>    delay/rate with xset?

DevicePresence are sent for each device added, removed, enabled and
disabled. For servers 1.7 and later, an XIDeviceHierarchChanged event is
sent as well.

> 4. After I plugged in the external keyboard, I have two keyboards.
>    While the internal one uses my custom keymap and rate/delay
>    settings, the external one has defaults. This makes me think that
>    Xorg keeps these settings per-device. However, neither xset nor
>    xkbcomp seem to allow me to specify a "target device", so that
>    I do not seem to be able to configure just one device, but always
>    have to configure all of them. Am I overlooking something?

xkbcomp -i <device id>, as I said xset doesn't let you do that.

Cheers,
  Peter



More information about the xorg mailing list