New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Mod-taps frequently getting stuck #986
Comments
Can you share your keymap that you reproduced this with? I tried to reproduce with a test case but haven't had luck so far. I am interested because I also get occasional stuck mods that I haven't been able to log but this sounds like a good lead. |
Sure, here's my config: https://github.com/elkowar/zmk-config/blob/master/config/boards/shields/choctopus44/choctopus44.keymap @buffet had also reported stuck home row modifiers to me a few days before, but is not encountering them anymore - I assume my case is not the only way to run into this bug |
Thanks, I don't see GUI mod-taps in that keymap but I guess they would be set up similar to the SHIFT ones. |
Yea, sorry, I removed them as they where causing too many issues currently ^^
and where on the d and k keys |
I also got this bug on my layout: I have configured |
This issue occurs about 20-40 times for me a day. My full keymaps are here:
I haven't done the same thorough investigation that elkowar has, but each modifier gets stuck in proportion to how frequently I use it (S->C->M). (EDIT: Previously I said it usually happens during layer toggles, but that's not accurate. It happens all the time). |
Yea, I still have the issue, and I've mostly had to pretty much just avoid using mod taps completely for now, which is kinda painful,... |
I think I'm encountering this, I'm going to do some extra work to try and reproduce it reliably. |
does this only happen if you have 'quick-release' and/or 'retro-tap' configured? |
The accidental cleanup of the hold-tap must be happening in the timer (the other place where we clean up hold-taps has an additional line of debug prints) However, this code path can only be followed when So how can it be possible that the key is not released? In the keymap examples, retro-tapping is disabled, so that's not the answer either. I don't see how this bug can happen :( |
@okke-formsma, I'm using Nice!Nano 2.0s and have tested with a Kyria, Corne, and Lily58. I have some unbuilt BlueMicros lying around that I could build, but I'd need a week-ish to get back to you. My config for home row mods was this before I gave up:
I had tried with retro-tap before, but I'm not seeing it in my config now. I started hitting this issue about 70-100 times a day, and did a very naive pass at the code. I didn't get the same error messages at elkowar, but used their debugging efforts to make an attempt. The changes I made in this commit (again, I don't know what I'm doing, but thought to experiment) reduced the occurrences down to about 5-8 a day. However, with these changes, when a mod tap issue was triggered, my entire keyboard would cease to work until a reset. |
After reading the logs in the initial post more carefully, I think the following sequence may be the root of the issue:
Told-tap 21 is not cleaned up to early - it was never actually registered because the key down event is still in the queue for hold-tap Two seconds later, the key down event for HT 21 is released, causing a key-down without a key-up.
This could be an interplay between combos and hold-taps 🤔 Aaaah the plot thickens - there's a combo at play in the keymap on the positions 14 and 21:
|
That's a very clean number in binary: Makes me wonder if there's an overflow, max int size, or similar curmudgeonry occurring. |
I'm getting this or a similar issue on my hummingbird. The strange thing is I haven't got this issue on any other board using a similar config |
@mrlinuxfish do you use different combos on your hummingbird? |
I have thumb combos (which are also on the Zaphod and and ble-Chiffre). The hummingbird also has overlapping combos on the bottom row to emulate the bottom corner keys |
I have not noticed any stuck keys after reducing my tapping term to 150 from 200. It may be coincidence or the timing window for this bug is smaller with the shorter tapping term. Either way the tighter tapping term works better for me overall even if it doesn't fix the issue. Update: it's still having issues on 150 tapping term but the tighter timing seems to mitigate the issue somewhat |
Curious, anyone here experiencing this that was not connected to more than one profile? I connected to a second profile and started to constantly get the issue. I disconnected from one and it's been good since. Might be coincidence, but thought I'd ask in case. |
Unfortunately this isn't the case as I only use my Sweep with nice!nano v2s at work. I just tried to switch to Callum-style mods using sticky modifiers on layers on the home row and am experiencing stuck mods almost instantly upon flashing/using them. The weird thing is that I have a sticky shift on my base layer which has NEVER caused this issue. I also have home row mods on my base layer which have never caused this issue either. Additionally, I have combos (and overlapping combos) against all of the keys used for home row mods and for the mods on the layers. My full config is here if it helps. Note: My sticky key mods are using |
Hey all, have a fair bit more information to add to this issue. TLDR: This appears to be an issue introduced to the core Reasoning:
Hopefully this helps in narrowing down the cause of this bug. It's been pretty annoying in the last few days since recompiling as I need to have a spare keyboard handy to "unstick" the mods. |
I tried going back to pre-December 23 with no luck. However I have had some luck by removing some combos: However these changes to my combos seem to have made it go away. |
Chiming in, I cut all of my combos and am still experiencing the issue. As for pre-December, I personally have had this issue consistently since getting nice nanos in Sept 2021 |
Small anecdote to add to this issue: I have just moved to using Callum-style mods instead of mod-taps and the issue has completely disappeared. So definitely appears as if the issue is within the implementation of passing mods to the hold (or more likely, the release) portion of the |
@elkowar and @okke-formsma. I can reproduce this by typing in Notepad++ with the left hand (main side of the keyboard), which has To reproduce:
Therefore, I can affirm that a combo can affect homerow mod. This behavior was repeatable for other &hm keys, as well as repeatable for keys on the right half. For now, my work around is to makes sure that my combo timeout-ms is not longer than my < tapping-term-ms. I hope this helps debug this problem! |
Randomly trying out things to see if mitigates the issue with mod-taps getting stuck. Possibly related: zmkfirmware/zmk#986, zmkfirmware/zmk#905
Adding one more observation: This issue got significantly mitigated (EDIT: solved?) for me when using equal timeouts for all my combos. I used to have overlapping combos with different timeouts on almost all my alpha-keys, and my HRMs would get stuck virtually all the time. Setting all combo timeouts to the same value seemed to have solved the problem (EDIT: as of 11 days later, I haven't yet encountered this issue at all). Possibly related: #905 |
Randomly trying out things to see if mitigates the issue with mod-taps getting stuck. Possibly related: zmkfirmware/zmk#986, zmkfirmware/zmk#905
Please feel free to re-open if you encounter this again w/ latest |
added a word delete to a pinkie combo changed the shift behavior from a plain sticky thing to a hold-tap that outputs shift if held and sticky shift if tapped, according to the comment here: zmkfirmware/zmk#986 (comment) This is different from how I tried to implement this last time. I think this will work.
I've noticed more and more that my home-row modifier mod-tap keys keep getting stuck from time to time. So I did some analysis.
Assuming both S and L are configured as mod-taps for LSHFT and RSHFT respectively, and D and K are both mod-taps for LGUI. A tapping term of 150 is being used.
the following inputs consistently result in the shift modifier being stuck (which is then only resolvable by hitting reset)
HOLD(s), WAIT(200ms), TAP(l), RELEASE(s)
additionally, the following inputs:
HOLD(s), WAIT(200ms), TAP(k), RELEASE(s)
result in no immediate change, until either d or k (either of the mod-taps for LGUI) are tapped again. As soon as either of them is tapped, the gui modifier starts being stuck as held down.
Looking at the logs, I observed the error message
ACTIVE_HOLD_TAP_CLEANED_UP_TOO_EARLY
Here is some more log output (this is showing the first input pattern I describe):
The text was updated successfully, but these errors were encountered: