Skip to content

Advanced usage: Custom Device-Tree

This is an advanced feature that allows you to specify additional ZMK configuration in the form of Device-Tree (DTSI) configuration. It is very powerful and also requires good understanding of ZMK Device-Tree configuration.

Custom Device-Tree

Compared to Custom Defined Behaviors, Custom Device-Tree provides an even more generic way to inject configuration into the keymap DTSI file. While Custom Defined Behaviours are injected within a device tree root node (/ { … }), Custom Device-Tree is injected at the top level.

The primary use of Custom Device-Tree is to re-define the parameters of existing Device-Tree nodes, which are specified using their &label. This is the method used to configure several different global settings in ZMK, such as the default mod-tap interval.

Some examples follow:

Changing the default tapping term for mod-tap behaviors
&mt {
    tapping-term-ms = <400>;
};
Changing the continue list for caps-word
&caps_word {
    continue-list = <UNDERSCORE MINUS>;
};

Note

Even though it is possible to define custom behaviors in Custom Device-Tree, this is not a good practice and should be avoided.