Skip to content
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

is sm_td compatible with the update_tri_layer_state? #25

Open
AnyRoad opened this issue Sep 25, 2024 · 3 comments
Open

is sm_td compatible with the update_tri_layer_state? #25

AnyRoad opened this issue Sep 25, 2024 · 3 comments

Comments

@AnyRoad
Copy link

AnyRoad commented Sep 25, 2024

Hi, thanks for the great home row mods implementation!

Just tried it and everything works fine except the Tri Layers:
https://docs.qmk.fm/ref_functions#update-tri-layer-state-state-x-y-z

Same config works with accordion but does not work with sm_td.

//**************** tri-state layer *********************//
// 
layer_state_t layer_state_set_user(layer_state_t state) {
   return update_tri_layer_state(state, CONTROLS, INTELLIJ, EXTRAS);
}

I don't know much about QMK internals but it seems like SMTD_LT activates target layer and turns others off, right? (like TO) That's might be the reaason why we cannot use tri state layers

#define LAYER_PUSH(layer)                              \
    return_layer_cnt++;                                \
    if (return_layer == RETURN_LAYER_NOT_SET) {        \
        return_layer = get_highest_layer(layer_state); \
    }                                                  \
    layer_move(layer);

#define LAYER_RESTORE()                          \
    if (return_layer_cnt > 0) {                  \
        return_layer_cnt--;                      \
        if (return_layer_cnt == 0) {             \
            layer_move(return_layer);            \
            return_layer = RETURN_LAYER_NOT_SET; \
        }                                        \
    }

Do you think it is possible to modify the implementation to make it work with the Tri State Layers?

@AnyRoad
Copy link
Author

AnyRoad commented Sep 25, 2024

#21 (comment)

So all custom functions with layer switching won't work here.

Seems like it applies to the Tri State Layers as well :(

@stasmarkin
Copy link
Owner

Yep, tri-layers are not supported.
Added this to a backlog. Tbh it's not first priority feature right now, but in a version or two I will implement this.

@AnyRoad
Copy link
Author

AnyRoad commented Sep 26, 2024

Thank you! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants