-
Notifications
You must be signed in to change notification settings - Fork 489
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
Add Tri_Layer_State submodule to layers module #658
Conversation
Module that allows for Tri_layer_state function
ran the make fix-isort fix-formatting test
This version has the same issues as the one before:
|
This is not the case here. that was the point of
This is not the case either. You can import the Trilayer module independently using
Wouldn't this be a bit more of a Want than a Need? |
Debating on closing out this PR. I have been working on integrating this with the layer module, also doing the suggestion of @xs5871. A global dictionary example: trilayerstate = {
(1, 2): 3,
(1,3): 4,
} Where the first 2 numbers behind the colon are the combo's and the last is the result of those combos. I don't think asking for a Quadlayerstate is a reasonable ask. The logic to make this work is quite a bit more complicated than my minimal coding experience can handle. A couple of question now,
|
That wasn't what I meant, should have made it more clear. The part that checks
The trilayer module uses a completely different heuristic to add and remove
Using the same keys and the same heuristic as the layer module is a need, not |
Very quick answers:
High, or at least not a merge blocker. Depends on the rest of the code, obviously, but that's something we can figure out together.
"ComboLayers" or "LayerCombos", something like that. Both are more meaningfull than Trilayer or Multilayer.
No, here's why: Feature parity is not the same as copying APIs and naming schemes. Feature parity means you can achieve the same function/behaviour/etc. Doesn't mean it has to look the same. |
Closing this PR and starting a new one for ComboLayers. |
--------- Co-authored-by: xs5871 <[email protected]>
--------- Co-authored-by: xs5871 <[email protected]>
--------- Co-authored-by: xs5871 <[email protected]>
--------- Co-authored-by: xs5871 <[email protected]>
TRI_LAYER_STATE
#Keycodes
KC.RAISE
KC.LOWER
Behavior
Tri-state layers is a feature that allows you to access a third layer by activating two other layers.
Changing Layers
By default, the default layer is 0, lower is 1, raise is 2, adjust is 3.
To change which layers are affected by the "lower raise adjust" add this just above your keymap.
Without Tri Layer State
For most usecases, the way you would create a "Tri_Layer_State would be to have KC.MO(x) KC.MO(y) and KC.MO(z) on opposing layer keys. This works out fine for most people. The issue you run into is if you press KC.MO(X), Then KC.MO(Y), to get to KC.MO(Z); then you release KC.MO(X), and continue holding KC.MO(Y), it stays in KC.MO(Z). To get back into KC.MO(Y) you need to release KC.MO(Y) and press it again.
With Tri Layer State
With Tri_Layer_state you can set opposing LOWER and RAISE keys. With the example above where you are not using tri layer state, when you release KC.MO(X) it will switch back to the state of KC.MO(Y). Each key acting independently.
With the way this is implimented in KMK (unlike in QMK) you can still access layer 3 independently.
Here is a Real world usecase:
You type a symbol on the raise layer, you have set enter to be on the lower layer. You quickly want to let go of raise and go to lower to press enter. You can do this as quickly as your finger releases raise with tri layer state. Without it, you could potentially hit lower before you let go of raise, causing you to be stuck on the adjust layer instead of lower.
Example code