#layer mod changes back to original layer incorrectly when using multiple lm keys

1 messages · Page 1 of 1 (latest)

woeful dragon
#

Hey, when using the lm macro from the zmk docs I've noticed that if you have multiple lm keys setup for a single layer if you press 2 or more of them and then release one, the layer gets removed while youre still holding a lm key.

I have my keyboard setup to go to a qwerty layer when any of the modifiers (except shift) is pressed; sometimes I go to press something like meta+i to go to settings but I accidentally tap and release alt and it goes to the original layer and presses meta+L instead, locking my pc. does anyone know of a good way to fix this behaviour? I think having a separate duplicated layer for each modifier could work but thats a bit janky.

I was also thinking that if there is a way to check for the other keys being released before releasing the layer? something along the lines of this:
lm: lm {
compatible = "zmk,behavior-macro-two-param";
wait-ms = <0>;
tap-ms = <0>;
#binding-cells = <2>;
bindings
= <&macro_param_1to1>
, <&macro_press &mo MACRO_PLACEHOLDER>
, <&macro_param_2to1>
, <&macro_press &kp MACRO_PLACEHOLDER>
, <&macro_pause_for_release>
, <&macro_param_2to1>
, <&macro_release &kp MACRO_PLACEHOLDER>
, <&macro_param_1to1>
// if all modifiers are released
, <&macro_release &mo MACRO_PLACEHOLDER>
// else
// return
;
};

hollow bobcat
#

All of the modifiers go to the same layer?
...Have you considered adding plain modifiers on that layer instead of allowing the keypress to fall through and hit your &lm macro?

Ah, I was thinking of my nav layer

woeful dragon
#

I ended up trying having a duplicated layer for each lm key, which does work, although not the most elegant solution it'll be good enough for me. I might look into the layer locking you linked in the future if it gets added

bleak cedar