ZMK hold-tap confusion
Not sure where to ask this, but I'm trying to understand ZMK hold-tap behavior's tap-unless-interrupted flavor. The explanation (https://zmk.dev/docs/keymaps/behaviors/hold-tap) says that 'tap-unless-interrupted' triggers a hold only when another key is pressed before tapping-term-ms has expired. But their diagram (last two cases in attached image) seems to show that you can press another key (j) before tapping-term-ms expires and still get the tap behavior (f). I've been using this for a while and never got the last two cases to work (pressing another key always triggered the hold behavior). Are those two cases wrong? Is this like a once in a million thing? It would be pretty annoying if the behavior switches on me at random
4 Replies
The ZMK documentation can be a bit confusing. The diagram is correct, but it's easy to misinterpret.
With
tap-unless-interrupted
, the tap action happens if the key is released before another key is pressed. If another key is pressed before the hold-tap key is released, then the hold action is triggered.
The tapping-term-ms
is the time window where the tap action can be triggered. If you press another key within that window, the hold action is triggered. If you release the key within that window, the tap action is triggered.
Does that make sense? Let me know if you have any other questions!As far as I know, there is not a diagram in the docs for
tap-unless-interrupted
. The one you showed is for tap-preferred
. I think the diagram that is most similar to tap-unless-interrupted is the hold-preferred diagram, except that what happens when the tapping term expires is a tap, rathrer than a hold, if no other key interrupted.
To continue using the LSHIFT F example, the behavior for tap-unless-interrupted should be:
- if you hit the key and release it fast, before any other key, it is a tap: just f
- if you hit the key and then hit J fast before releasing it, it is a hold and left shift affects the interrupting j: output is J
- if you hold the key longer than the tapping term, then nothing has a chance to interrupt and it is a tap: just f
I do not know whether the long-press tap is decided when tapping-term expires or when you release the key. You can test that by holding it for a really long time: if f
shows up after a fifth of a second, then it is constrained by tapping term
What is the behavior that you hope for from it? If you are implementing home row mods, you might find tap-preferred
or balanced
more to your liking.
pretty sure that the default if you do not specify a flavor is hold-preferred
omg you're right I completely just looked at the rightmost diagram and assumed that was it, they really should add that in at some point. Yep the tap-unless-interrupted is perfect for me, I'm using it to combine mouse clicks with a momentary layer, just wanted to confirm my understanding of it was correct, thanks for the clarification!
@UNcoilED , check out urob's "timerless" home row mode config. I've been using it for some time and I essentially never have any issues with misfires. I believe it uses the "balanced" flavor.
https://github.com/urob/zmk-config?tab=readme-ov-file#timeless-homerow-mods
GitHub
GitHub - urob/zmk-config: Personal ZMK firmware configuration for v...
Personal ZMK firmware configuration for various boards (34-keys, Corneish Zen, Planck) - urob/zmk-config