[PATCH] Allows holding down two keys to repeat both ("Two-key repeat")

Thomas Ross thomasross at thomasross.io
Tue Mar 1 23:54:01 UTC 2016


Hi,

Germain and I have developed a new patch to add "n-key repeat" (controlled by a variable, potentially could be set with xset.
The patch can be found here: https://git.framasoft.org/bobo/xkb_repeat/blob/master/patches/xkb-repeat-pattern.patch

I think that we should cancel/ignore this patch and potentially merge the n-key repeat one instead.

Thoughts?

Thanks,
Thomas.

On 29/02/16 05:59 PM, thomassross wrote:
> From: Germain Bossu <germainbossu at yahoo.fr>
> 
> https://git.framasoft.org/bobo/xkb_repeat/blob/master/patches/xkb-repeat2-easy.patch
> ---
>  include/xkbsrv.h | 1 +
>  xkb/xkbAccessX.c | 9 +++++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/include/xkbsrv.h b/include/xkbsrv.h
> index cc6307a..5d8d913 100644
> --- a/include/xkbsrv.h
> +++ b/include/xkbsrv.h
> @@ -173,6 +173,7 @@ typedef struct _XkbSrvInfo {
>      KeyCode slowKey;
>      KeyCode slowKeyEnableKey;
>      KeyCode repeatKey;
> +    KeyCode repeatKey2;
>      CARD8 krgTimerActive;
>      CARD8 beepType;
>      CARD8 beepCount;
> diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
> index 02e820b..e0a135c 100644
> --- a/xkb/xkbAccessX.c
> +++ b/xkb/xkbAccessX.c
> @@ -80,6 +80,7 @@ AccessXInit(DeviceIntPtr keybd)
>      xkbi->inactiveKey = 0;
>      xkbi->slowKey = 0;
>      xkbi->repeatKey = 0;
> +    xkbi->repeatKey2 = 0;
>      xkbi->krgTimerActive = _OFF_TIMER;
>      xkbi->beepType = _BEEP_NONE;
>      xkbi->beepCount = 0;
> @@ -318,6 +319,8 @@ AccessXRepeatKeyExpire(OsTimerPtr timer, CARD32 now, void *arg)
>          return 0;
>  
>      AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, TRUE);
> +    if (xkbi->repeatKey2 != 0)
> +        AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey2, TRUE);
>  
>      return xkbi->desc->ctrls->repeat_interval;
>  }
> @@ -327,6 +330,7 @@ AccessXCancelRepeatKey(XkbSrvInfoPtr xkbi, KeyCode key)
>  {
>      if (xkbi->repeatKey == key)
>          xkbi->repeatKey = 0;
> +        xkbi->repeatKey2 = 0;
>      return;
>  }
>  
> @@ -541,6 +545,10 @@ AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd)
>                      DebugF("Starting software autorepeat...\n");
>                  if (xkbi->repeatKey == key)
>                      ignoreKeyEvent = TRUE;
> +                else if (xkbi->repeatKey != 0)
> +                    xkbi->repeatKey2 = key;
> +                else if (xkbi->repeatKey2 == key)
> +                    ignoreKeyEvent = TRUE;
>                  else {
>                      xkbi->repeatKey = key;
>                      xkbi->repeatKeyTimer = TimerSet(xkbi->repeatKeyTimer,
> @@ -644,6 +652,7 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd)
>       */
>      if (xkbi->repeatKey == key) {
>          xkbi->repeatKey = 0;
> +        xkbi->repeatKey2 = 0;
>      }
>  
>      if ((ctrls->enabled_ctrls & XkbAccessXTimeoutMask) &&
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160301/6a4c3af0/attachment.sig>


More information about the xorg-devel mailing list