Autorepeat does not work for custom key defined via XKB
Submitted by Hanno Zulla
Assigned to Xorg Project Team
Description
Hi there.
There appears to be a bug with how X.org handles the "repeat" setting in xkb definitions.
Bought a chromebook and installed a non-ChromeOS Linux distribution on it.
Chromebooks come with a limited set of keys for ease of use and then make missing keys available through modifiers, e.g.:
Up = <UP>
Prior = Alt+<UP>
Home = Ctrl+Alt+<UP>
(see https://support.google.com/chromebook/answer/1047364?hl=en)
I'm trying to get these keyboard shortcuts to work within my Linux system and fiddle with a custom, system-wide xkb setting right now.
(The ChromeOS guys used to use xkb for this purpose, as well. But some time ago, they have moved their re-mapping of these keys from xkb into the user space applications, instead: http://git.chromium.org/gitweb/?p=chromiumos/overlays/chromiumos-overlay.git;a=commitdiff;h=9b26b7aba4402bf97cee5cae8333175748160f62)
My current work-in-progress solution with xkb looks somewhat like this:
In types/pc, add:
type "CTRL+ALT_ACTUALLY" {
modifiers = Control+Alt+Shift;
map[None] = Level1;
map[Shift] = Level2;
map[Alt] = Level3;
map[Shift+Alt] = Level4;
map[Control+Alt] = Level5;
preserve[Shift] = Shift;
preserve[Shift+Alt] = Shift;
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
level_name[Level3] = "Alt Base";
level_name[Level4] = "Shift Alt";
level_name[Level5] = "Ctrl+Alt";
};
// see https://bugs.freedesktop.org/show_bug.cgi?id=78139
In symbols/inet, add:
// Chromebook keyboards partial alphanumeric_keys xkb_symbols "chromebook" {
key <UP>
{
type="CTRL+ALT_ACTUALLY",
repeat=yes,
symbols[Group1] = [ Up, Up, Prior, Prior, Home ]
actions[Group1] = [
NoAction(),
NoAction(),
RedirectKey(key=<PGUP>
, clearmods=Alt),
RedirectKey(key=<PGUP>
, clearmods=Alt),
RedirectKey(key=<HOME>
, clearmods=Control+Alt)
]
};
// similar for other keys
};
This works, but autorepeat doesn't work for this custom <UP>
definition.
I found a patch from the ChromeOS guys that seems to address this problem http://git.chromium.org/gitweb/?p=chromiumos/overlays/chromiumos-overlay.git;a=blob;f=x11-base/xorg-server/files/1.7.6-fix-xkb-autorepeat.patch;h=8bad5abc5ad3958f6d73c55c67d3883ac775db18;hb=c3ce41719abc82a257e1fef1c499ea2e7c6b3c32
...I commented out the two lines of code mentioned in the patch for the current version on my system, but that didn't fix the issue or I'm using it wrong.
So I kindly ask you to have a look at that patch or see if there is a better way to fix this issue.
I'm running x.org 7.7 as pre-packaged by Ubuntu for their 14.04 release (7.7+1ubuntu8).
Thanks!
Version: 7.7 (2012.06)