Commit graph

2 commits

Author SHA1 Message Date
Sophie Tyalie
dadf1e611f Behavior: Change way lock keys are defined in dts
Previously the definition was copied almost 1:1 from the `none` behavior
in order to set up the important files and have a small running, but
featureless sample.

This change introduces a way to actually configure the custom lock
behavior, using the following syntax:

```
behaviors {
  dead_lock_prevent {
    compatible = "zmk,behavior-custom-lock";

    // to define a key
    dead: dead_key {
      #binding-cells = <2>;
      bindings = <&kp>, <&kp>;
    }

    // or to define a macro
    deadm: dead_macro {
      #binding-cells = <2>;
      bindings = <&macro>, <&kp>;
    }
  }
}
```

Additionally, there's now no standard definition flying around (deletion
of `dts/behaviors/custom_lock.dtsi`)

Signed-off-by: Sophie Tyalie <dev@flowerpot.me>
2022-11-17 13:14:57 +01:00
Sophie Tyalie
776b118d95 CustomLock: add basic file structure
This is the first commit introducing custom lock behavior. Currently
does nothing, except existing and that one can reference it in the
keyboard layout not dissimilar to e.g. `&none`.

The code is also orientated along the latter for right now, ready to be
extended.

Signed-off-by: Sophie Tyalie <dev@flowerpot.me>
2022-11-15 16:40:47 +01:00