#Where to put configuration for a behaviour (eg. `&mt { flavor = "balanced" }`)

1 messages · Page 1 of 1 (latest)

gleaming falcon
#

Hi, I'm new to ZMK but a fairly seasoned QMK user. I want to use the balanced flavour for &mt and &lt behaviours, but I don't understand where to put that configuration.

I can see for example that in https://zmk.dev/docs/behaviors/hold-tap#retro-tap there's a suggestion to enable retro-tap using:

&mt {
  retro-tap;
};

so I'm guessing similarly I could do:

&lt {
  flavor = "balanced";
};

But I'm not sure where to put a block of this sort. I tried putting it inside behaviors in my keymap, and also after behaviors in the same {} block. Both incur a parse error.

Or do I have to create a custom behaviour using compatible = "zmk,behavior-layer-tap" and fill in all the properties, just to tweak the default config?

#

Now I can see in https://zmk.dev/docs/config/behaviors behaviours that against each behaviour there's a note saying "You can use the following nodes to tweak the default behaviours". So my question is just: where do I put those nodes?

Some behaviors have properties to adjust how they behave. These can also be used as templates to create custom behaviors when none of the built-in behaviors do what you want.

wraith meadow
#

You can put them “parallel” to the root node in your .keymap file. That is just like in your two examples above without any further nesting

gleaming falcon
#

Oh, next to the devicetree node? I didn't even try that as it seemed the least probable

#

Like this?

/ {
  chosen {
    // zmk,matrix_transform = &default_transform;
    zmk,matrix_transform = &five_column_transform;
  };
};

&lt {
  flavor = "balanced";
};


/ {
  behaviors { ... };

  keymap { ... };
}
wraith meadow
gleaming falcon
#

Ok thank you. I wish the docs had a page that explained the basics of the syntax. (Or have I missed one?)

wraith meadow
#

There might be a link to the device tree format docs. But I agree, getting familiar with the dts syntax takes a bit of time if you haven’t used it before

gleaming falcon
#

Ah so there's a name for the syntax! This is useful 😄

#

Shame that's obfuscated by the .keymap extension. If it had a .dts extension I might've looked that up.

polar wind