-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Recent commit breaks LT(5,KC_J) on FC660C #8600
Comments
Hi @Syzygies, as I can see currently you are using |
Struck the same thing on a test board locally -- KC_NO on target layer causes issue, KC_TRNS on target layer makes it work fine. |
When you use keycodes that activate a layer such as |
I will make all tests suggested so far, including binary search to locate the commit responsible for this. As for "the keycode at the same spot on the target layer must either be KC_TRNS or the exact same keycode" I did notice this in the doc, and I noticed that it had never applied to me before. Is there an explanation anywhere? Anti-bounce? 16 bits? If it was "fixed" by accident, can we fix it for real? If I write my own loop, will this still apply to me? It's dumb luck / serendipity that my ANSI symbol layer needs 28 symbols, and there are 30 core keys in common for every keyboard I can imagine. I was using the two holes for redundant Backspace and Delete keys, but I can instead put the two holes under the tap/hold keys (in my case FJ) that access this layer. I really don't want to punch a hole in my number layer. I actually generate my keymap.c file (and the layout diagram) from a .tsv file. I could reprogram all this to create a pair of layers for each conceptual layer, differing only in the location of this required hole. I would feel silly doing this, if it were easy for me to instead eliminate this restriction. And the posted code is missing a layer I took back out as part of debugging. One reads elsewhere restrictions on going past 16 layers, e.g. the MT code. If I'm using two actual layers for each conceptual layer, I'll soon run out. |
For reference, I bisected it, |
I was unable to locate this commit on GitHub, but I have it in my terminal:
My suspicion from viewing this in my terminal is that the breaking changes are in post_process_record_user(), but I'm not sure, and I don't understand the code that well. |
I can also confirm this is my issue. Creating a pair of layers for each conceptual layer is a workaround. I'll try to figure out the exact code that is causing this, within the |
To elaborate on why this is not supposed to work, we have to consider how keycodes are resolved. When a key is pressed, QMK searches through all active layers from highest to lowest. When, say, a On keyup, the same thing happens, but this time since the layer is active, the layer scan hits that keycode. If it's a |
Thank you, that helps. I've redone my layout after thinking this through. I've automated the necessary duplication of layers, to work around this restriction. My fc660c syzygies keymap shows these changes. It's important to me that my keyboards offer a base layer that is as safe as possible. Say, a student wants to borrow my office keyboard (not a current concern), and I don't want them accidentally rearranging the orbits of the planets. So I was worried that because of this behavior, I'd be forced to give up a key on my safety layer, to support switching back to it from advanced layers. Fortunately, the following works: Provide access to one's function layer from the backspace key using LT(2,KC_BSPC), and put TG(1) somewhere on that function layer. This passes testing; I can go back and forth successfully while avoiding this issue. So is this still a bug report, or a user whose luck ran out? I'd still like to understand the code for myself; if this is easy enough to fix that it temporarily got fixed by accident, my vote would be to adopt the fix. This restriction leads to less efficient layouts. I have a GergoPlex: Heavy on order, but he has some really small boards too. Ideally, doesn't one want to cache the identity of a keypress so the keyup is interpreted the same way? Instead rescanning active layers almost works, except for this issue. My guess is that this is historical, an artifact from TMK. Does anyone actually rely on this as a feature? No one seems to have reported the bug while this behavior had accidentally changed. In any case, it appears that I can ultimately duck all of this by providing my own |
Out of interest, how does this relate to the use of OSL? I have a LT(_LTRAN, KC_SPC) with OSL(_L2) set for key X on layer _LTRAN, hitting X again should invoke a macro on _L2, previously it would return to the original layer, this is now changed. I'm assuming that OSL semantics have now changed in line with the above in that I cannot use the key X on _L2 with now has to be KC_TRNS but instead some other key. |
I ran into the same issue. Here is as simple use case I created: https://github.com/newtonapple/qmk_firmware/blob/newtonapple/layerbug/layouts/community/ortho_4x12/newton/keymap.c. I personally have few usecases where I put different |
Necessarily so. Think about it: if you hold an |
That was exactly my fix; I use a Ruby script to generate actual layers from a tab separated values file, cloning near-identical layers as needed. And I'm just about out of layers. The firmware sees which physical key (xy-matrix) is pressed and released. The firmware could cache each physical xy-matrix location separately, saving the meaning of each key when it goes down, and using that meaning when the key comes back up, ignoring all layer changes that have happened since. It doesn't do this; the firmware instead rescans using the now-current context. That is an artifact inherited from FMK, not a law of physics. And somehow this all got fixed by accident, for a while! I still don't understand the relevant code. |
I also encountered this just now. The LT is permanently staying on that layer anymore. I thought I was doing something wrong as this has always been my configuration. My keyboard is kbdfans dz60 rgb ansiv2. Thanks. |
Oh, I think I see what the issue is .... |
Okay, narrowed down the issue. An unintended, and odd ... one. Specifically, the cause is that this is getting called: qmk_firmware/quantum/quantum.c Line 165 in 6de7714
It's updating the layer cache, it would appear, and causing the issue. Fortunately, this does appear to be a simple fix, at least. (tested already). |
For anyone running into this issue, could you test the above PR and verify that it fixes the issue? If you need help testing it, let me know. |
I have to step out, I'll finish testing in an hour, but for anyone else, here is how I managed to pull in this commit:
|
Thanks! This commit also fixes my reported problem. However, my testing uncovered a related problem I don't understand. It is definitely related to / entangled in the logic of this commit, though this commit did not introduce the problem. I usually access my layer 3 (FJ) and layer 4 (DK) temporarily using FJ, DK as tap/hold keys. However, I sometimes want to lock those layers on. So I made the capslock key for those layers I thought of this after editing my script to create near-identical layers with transparent keys, to work around the issue of this bug report. That fix accidentally made my Using tap/hold FJ to access layer 3 for the purpose of executing Confused? I was. This was amusing to identify. My own fix for the previous problem was obscuring this problem. Here is a cached copy of my layout: fc660c I added |
That won't work. Those toggle layers 3 and 4 on/off. However, it reads "highest"/top down, so it will read 5 and 6 before 3 or 4. So ... it may break that. But ... I'll test TG in just a sec. Edit: I tested this on my keymap (swapping out LT for TG, directly) and TG doesn't seem to be impacted. @newtonapple and anyone else, if you could approve the PR in question (go to "files" in the PR and you can approve it there). You won't get a green check (it will be grey), but it helps us know that it's tested and fixes the issue. |
I edited my previous comment in light of further testing. This is not the same as swapping out LT for TG, directly. It is an interaction between LT and TG. To be clear, |
Also, a good question is, did this happen before the code change in question? (commit ID 5117dff ) |
I've made a couple more changes, and hopefully, that's still fixed (for those that applied my branch/PR) |
As far as I can tell, this has never worked. I tested back to October 2019 (commit ID de29da973). I couldn't go back much further without my builds breaking for what I assume are unrelated reasons:
Should I file a separate bug report, or wait to see what you conclude? The workaround is clear: Don't depend on However, layer three is where one wants the I can't see a workaround, other than duplicating layers exactly as I did before you fixed this first bug. Or make capslock itself a tap/hold key, and put all the Thanks! |
I have the exact same problems, I will test tomorrow. I have add LT() on almost every key of my home row for many years. Luckily this is a new kb. Obviously trans is not the best solution. I also have some osl() keys on the new xd75, those are on all layers via Trans, they do not work properly either. |
Hey, i just rebased the two commits of the open PR to my WIP split atreus. Awesome work! I did not notice any issues. Thanks! |
Describe the Bug
I had fallen 27 commits behind master while working on several keyboards. After catching up to March 28 by merging upstream master into my fork, LT(5,KC_J) and similar keycodes stopped working on my FC660C (they still worked on my Planck EZ; I have a DZ60 I didn't test). Rather than momentarily activating the layer, I get stuck in that layer until I unplug and reconnect the keyboard.
While exploring this bug, I added an emergency escape DF(1) from every layer back to my base layer. These keys failed to work at all; I remained stuck in the 'momentary' layer.
Reverting the 27 upstream commits fixed the bug.
My keyboard is fc660c syzygies
My master branch was caught up with the upstream master as of yesterday, and causes the problem. My syzygies branch is my development branch, that again works once I reverted it to discard these 27 commits.
My fork's git history should be public, making precise which commits I've fallen behind on.
System Information
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 8-2019-q3-update) 8.3.1 20190703 (release) [gcc-8-branch revision 273027]
0.8.79 (both branches report this same version)
Additional Context
On request I can do a binary search to determine which of the 27 commits is responsible, and I can see if the DZ60 is affected. Usually I find my less obvious bugs by waiting a few hours and seeing if I slap my forehead. If someone's forehead slap doesn't resolve the bug, but suggests a commit to look at first, that would save me time.
I am a Kinesis Advantage survivor, so of course the first thing I considered was dropped USB events, but that wouldn't explain the escape DF(1) not working, or reverting the 27 upstream commits fixing everything. This is not sporadic behavior, it is 100% reproducible.
The text was updated successfully, but these errors were encountered: