Secondary role - non modifiers / Superkeys

Is it possible to assign a standard function (key or key combo) to a secondary (held) function?K

Is it possible to realize superkeys like double-tap, tap-hold, double-tab-hold…?

Is it possible to assign a standard function (key or key combo) to a secondary (held) function?K

Yes, using smart macros.

Is it possible to realize superkeys like double-tap, tap-hold, double-tab-hold…?

There are the ifGesture and ifDoubletap commands, but they can’t distinguish taps from holds.

Thanks, that is helpful already. Is it also possible to define two keys pressed at the same (of course defining a time-span for “same time” trigger an action? I am thinking of using that approach for Shift and possibly also Ctrl, Alt function instead of home row mods?

Yes, ifShortcut, which is to be again bound on the first key of the chord.

Concrete smart macro examples for all five superkey types would be useful and much appreciated.

As an added bonus, I’m wondering whether it’s possible to inhibit triggering simpler actions for a while until more complex actions are triggered. For example, one may want to inhibit the first tap of a double-tap triggering its own action if a second tap is invoked within 300ms.

ifShortcut and ifGesture do exactly this.

I’ve been playing with smart macros to replicate superkeys, which are:

  • Tap
  • Hold
  • Tap and hold
  • Double-tap
  • Double-tap and hold

According to @kareltucek, hold cannot be detected, which leaves us with tap and double-tap. However, I also wanted to implement triple-tap.

When mapped to the C key, the following macro outputs 1, 2, and 3 upon tap, double-tap, and triple-tap, respectively:

ifGesture 89 89 final tapKey 3
ifGesture 89 final tapKey 2
tapKey 1

The above macro doesn’t output intermediate characters; triple-tapping C only outputs 3, but the following macro outputs 1, 2, and 3.

tapKey 1
ifGesture 89 tapKey 2
ifGesture 89 final tapKey 3

The first example is typing-friendly because it doesn’t output intermediate characters. The second example can be useful in games. For example, in first-person shooters, one can map the weapon numbers of the right half to left half numbers via double-taps.

Although superkeys currently can’t be fully implemented on the UHK, smart macros open up much more possibilities. One could specify per-gesture timeouts and tweak behavior as highlighted by the above examples.

2 Likes