How to make custom key type auto repeat in xkb

autorepeatxkb

I have defined a custom key type in my xkb configure file to do some redirection (e.g. redirect Ctrl+p to Up etc.) However, I cannot get auto-repeat work for this custom type (neither the original key (e.g. p) or the redirect action (e.g. Up redirected from Ctrl+p) has auto-repeat).

I have tried adding repeat=true, to keysyms configuration according to this from xfree86 mailing list but it doesn't work either.

Best Answer

There was a patch I stumbled onto within the Chromium OS repository that might help with this; it seems to have been removed after they actually patched it into Chrome itself. Not sure what happened with the QA for the patch or if it was sent upstream or not.

links here: X: Map Alt-Up and Alt-Down to Page Up and Page Down

The patch is as follows:

This is a probably-wrong fix for an issue where autorepeat
is disabled for keys assigned by XKB.  As far as I can tell,
XKB has the correct autorepeat settings for the keys before
a completely-empty autorepeat array from X is copied over
it; then the XKB array is copied back to X.  This makes us
skip the first copy.

diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 75e243c..bceb55c 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -342,9 +342,6 @@ CARD8 *         repeat;
     xkb= xkbi->desc;
     repeat= xkb->ctrls->per_key_repeat;

-    if (pXDev->kbdfeed)
-   memcpy(repeat,pXDev->kbdfeed->ctrl.autoRepeats,32);
-
     XkbUpdateDescActions(xkb,first,num,changes);

     if ((pXDev->kbdfeed)&&

I've yet to try it myself, but will probably take a shot at it in a bit.

Related Question