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
641 stars 57 forks source link

TRANS keys some times not picked up correctly #69

Closed anarion80 closed 7 months ago

anarion80 commented 7 months ago

Hello. I have the following piece of keymap:

ZMK_LAYER(Mouse,
&trans  &trans &trans &trans &trans &trans                          &trans U_WH_L U_MS_U U_WH_R &trans    &trans
  &trans  &sk LGUI  &sk LALT  &sk LCTRL  &sk LSHFT  &trans          &trans U_MS_L U_MS_D U_MS_R  &trans &trans
        &trans &trans &trans &trans &trans &trans                    &trans U_WH_D U_WH_U &trans &trans &trans
                             &trans &trans &trans    U_BTN3 U_BTN1 U_BTN2
)

notice the three transparent keys in left side thumb cluster.

Which then gets translated to a held key for some reason:

  - - {t: '$$mdi:transfer$$', type: trans}
    - {t: '$$mdi:transfer$$', type: trans}
    - {type: held}
    - $$mdi:numeric-3-circle$$
    - $$mdi:numeric-1-circle$$
    - $$mdi:numeric-2-circle$$

obraz

There must be some relation to other keys that I can't figure out - or a bug?

My complete keymap: https://github.com/anarion80/zmk-config-corneish-zen/blob/main/config/base.keymap My keymap_drawer_config: https://github.com/anarion80/zmk-config-corneish-zen/blob/main/keymap_drawer_config.yaml Resulting keymap.yaml: https://github.com/anarion80/zmk-config-corneish-zen/blob/main/corneish_zen_keymap.yaml generated using the following command: keymap -c keymap_drawer_config.yaml parse -c12 -z config/corneish_zen.keymap > corneish_zen_keymap.yaml

keymap version: 0.13.1

caksoylar commented 7 months ago

If I understand the issue correctly, this is the intended behavior. There is logic in the parser to automatically determine held keys, which aim to highlight what keys need to be held in order for that layer to be active. In your case, holding that thumb key is how you seem to enable the mouse layer from the base layer: https://github.com/anarion80/zmk-config-corneish-zen/blob/main/config/base.keymap#L228C54-L228C67 (It doesn't understand the &smart_mouse behavior as an alternative way to get there.)

Right now there is no way to disable this, but if you really don't want held key inference then I can add a config option to turn it off.

anarion80 commented 7 months ago

Ah, ok - now I get it. Makes sense. Thanks for the explanation, I will close the issue.