qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
18.28k stars 39.4k forks source link

[Bug] Combine two tap-dance keys with modifier on hold does not release modifier #9924

Closed weilbith closed 3 years ago

weilbith commented 4 years ago

I must admit that I fail to evaluate if any of the issues that popup during my search is related to this problem. If so I'm sorry for handing this one in. :pray:

Describe the Bug

I use a custom implementation of the MT() functionality with Tap Dance. Therefore I followed the documentation for Tap Dance examples. Here is my version of it. And here is the macro I use then in my keymap. The idea is that I can now use MT() as regular with the PERMISSIVE_HOLD option enabled and the custom Tap Dance ACTION_TAP_DANCE_MT() without PERMISSIVE_HOLD enabled. The latter is used for modifiers I have placed on regular alpha chars on the home row (ctrl and alt). Having PERMISSIVE_HOLD enabled here is a night mare. But still I don't want to miss this feature for the symbol or number layer.

Anyways the problem is now that if I combine two of such keys it makes the modifier stuck. Let's elaborate that. I have ACTION_TAP_DANCE_MT(KC_F, KC_LCTL) in my keymap. This is like MT(KC_F, KC_LCTL) just with the custom Tap Dance and without permissive hold. Furthermore I mirrored that to the over hand with ACTION_TAP_DANCE_MT(KC_J, KC_RCTL). Same as before. Both on their own work perfect. E.g. holding the j key to get RCTRL modifier (wait for the hold time) and then type c while holding. No permissive holding works here. The regular MT()s in my layout still work with permissive hold. Perfect. As intended. But if I want to type ctrl-j (as used in Vim for example), the LCTRL modifier does not get unset when releasing the f key from its hold. In fact the reset hook function of the first Tap Dance key doesn't get executed. Note here that this combo combines the Tap Dance hold-case of the f key with the Tap Dance tap-case of the j key. The reset hook of the j Tap Dance gets executed. From the QMK core code it looks to me like the state of the first Tap Dance key get lost, when another Tap Dance starts. This problem only resolves when I hold the first Tap Dance key (f in the example) again to trigger the reset function at the end. This is heavily annoying. And even I have build up already some kind of muscle memory for this and added backlight for these modifiers (to recognize a stuck modifier), I would love to solve this problem. After all I would also appreciate to have an option to set permissive hold per key, as possible for the timeout.

Thanks for any kind of help! :smiley:

System Information

weilbith commented 3 years ago

I don't use this feature anymore. Therefore I'll just close the bug now as nobody else seems interested and this is very special scenario.