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

[Bug] `held` property doesn't work if `raw_binding_map` use to override layer icon #113

Open dhruvinsh opened 2 weeks ago

dhruvinsh commented 2 weeks ago

Minimal config that breaks the held highlighting.

draw_config:
  dark_mode: auto

parse_config:
  raw_binding_map:
    # Layers
    "&lt NAV ESC":
      tap: $$mdi:keyboard-esc$$
      hold: NAV
    "&lt NUM SPACE":
      tap: $$mdi:keyboard-space$$
      hold: NUM
    "&lt SYM BSPC":
      tap: $$mdi:backspace$$

Without raw_binding_map:

image

With raw_binding_map:

image
caksoylar commented 2 weeks ago

The way raw_binding_map is used right now, it completely short circuits the usual processing if the key is found in the mapping. This includes analyzing the binding to see if it is a layer activator. I could see changing this, but I am curious if you have a practical use case for this where you'd need it, as opposed to using instead e.g.

parse_config:
  zmk_keycode_map:
    ESC: $$mdi:keyboard-esc$$
    SPACE: $$mdi:keyboard-space$$
dhruvinsh commented 2 weeks ago

The way raw_binding_map is used right now, it completely short circuits the usual processing if the key is found in the mapping.

Yeah the name raw make sense.

if you have a practical use case for this where you'd need it I was using to override how the Layer name appear.

For now I have switched to using zmk_keycode_map. If the idea of raw_binding_map of no processing and you plan to keep that way I am all okay for it.