5

I'd like to learn how to trigger something in my debian box on double-tap of a key (let's say l-shift). My setup is X11 based. Should I look into doing in my MW (xmonad) or on a lower level? Forgive my ignorance, but I'm used to windows and the wonderful autohotkey. Why? To remap ctrl to capslock, and have capslock on double-tap of l-shift.

97-109-107
  • 63
  • 1
  • 4

2 Answers2

2

The action of double-tapping would ideally be program-independent and should thus be implemented at a lower level than user programs or even window managers (which you don't want grabbing all keypresses to check for double-tapping).

The correct place to implement a feature like this would be in the X keyboard extensions. It could detect double tapping and let the user configure the keyname associated with it. Unfortunately, XKB does not yet support the action of double-tapping. You can do other cool things though, like remapping keys with xmodmap or even writing novel keyboard layouts (have look at the files in /usr/share/X11/xkb/symbols)

Jaap Joris Vens
  • 929
  • 10
  • 23
  • "Unfortunately, XKB does not yet support the action of double-tapping." -- is this still the case in 2022? – Aleksey Tsalolikhin Jun 06 '22 at 14:53
  • 2
    The XKB specification hasn't changed since 1996, and [their wiki](https://www.x.org/wiki/XKB/) hasn't been updated since 2013. I think it's safe to conclude that this feature will never be added. – Jaap Joris Vens Jun 08 '22 at 08:25
0

Even if not possible as of today, it seems a service like that implemented by evremap could be extended to support detecting and mapping double-taps in a custom way. If someone is very interested, it might be implemented there or in a fork. See the GitHub issue here.

jesusbriales
  • 101
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 29 '22 at 13:18