caksoylar / keymap-drawer

Visualize keymaps that use advanced features like hold-taps and combos, with automatic parsing
https://caksoylar.github.io/keymap-drawer
MIT License
586 stars 55 forks source link

Bug(?): `LS(LC(LALT))` type mappings in `zmk_keycode_map` stopped working #106

Closed minusfive closed 2 weeks ago

minusfive commented 2 weeks ago

Hey @caksoylar , been a minute!

Any idea when / why this stopped working? https://github.com/minusfive/zmk-config/blob/15c42330e30aaa12ecbbe742116d809d283ec65a/keymap_drawer.config.yaml#L613

It used to output the defined icon, now it just outputs the inner mod (LALT). Been wrecking my brain trying to sort it but haven't been able to figure it out.

Much appreciated.

caksoylar commented 2 weeks ago

Hey, hope all is well!

This was a breaking change in v0.16 when I added special parsing for modifier functions. Have a look at the release notes and the workaround there: https://github.com/caksoylar/keymap-drawer/releases/tag/v0.16.0

Let me know if it works out! I don't remember if there was a major blocker for keeping this, if it will be inconvenient because the same combination is used in multiple bindings, then I can look into reinstating it.

minusfive commented 2 weeks ago

Gotcha, thanks! Right, so in my case I'm using them as pure mods in my HMRs on all 3 layers, e.g.

#define MEH LS(LC(LALT))

/ {
  keymap {
    compatible = "zmk,keymap";

    layer_1_colemak_dh {
      bindings = <&hrml MEH G &hrmr MEH M>;
    };

//    layer_1_colemak {
//      bindings = <&hrml MEH D &hrmr MEH H>;
//    };

//    layer_1_qwerty {
//      bindings = <&hrml MEH G &hrmr MEH H>;
//    };

    layer_2 {
      bindings = <&hrml MEH N0 &hrmr MEH LEFT>;
    };

    layer_3 {
      bindings = <&hrml MEH F10>;
    };
  };
};

(You can replace the &hrml/rs with &mts, I'm using positional HRMs. Don't know why I'm telling you this 🤣).

So I'm not sure that case is supported, right? Like, using mod combinations as pure modifiers themselves? I'mma play with it for a bit, see if I can figure it out.

Here's the YAML output BTW: https://github.com/minusfive/zmk-config/blob/4db79477174f552576476c38ec68e39103e51906/img/corneish_zen.yaml#L21-L22

caksoylar commented 2 weeks ago

Yeah, I don't think the modifier fn configs would work for that. You can add each of those to raw bindings map but as I suspected, it will be inconvenient.

I'd like to reinstate the previous behavior, I will have a look when I am in front of a computer (sometime this week). It should be fine to look up the keycode map both before and after modifier fn related parsing.

minusfive commented 2 weeks ago

That's awesome, thanks! But yeah, no rush — workaround in place 😉:

Thanks!

(And vim macros FTW)

minusfive commented 2 weeks ago

I'm OK to close this issue, unless you want to keep it open to work on it?

caksoylar commented 2 weeks ago

Glad you got the workaround at least. Happy to see you updating 😄

Yeah, let's keep it open for now.