From 56d863cba6e26c49a43b6b1bf0404765823dfad6 Mon Sep 17 00:00:00 2001 From: Cem Aksoylar Date: Sun, 3 Dec 2023 23:04:28 -0800 Subject: [PATCH] feat(docs): Document sensor-rotate in behaviors config --- docs/docs/config/behaviors.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/docs/config/behaviors.md b/docs/docs/config/behaviors.md index db24f805..119b3d22 100644 --- a/docs/docs/config/behaviors.md +++ b/docs/docs/config/behaviors.md @@ -183,6 +183,27 @@ You can use the following nodes to tweak the default behaviors: | -------- | ----------------------------------------- | | `&gresc` | [Grave escape](../behaviors/mod-morph.md) | +## Sensor Rotation + +Creates a custom behavior which sends a tap of other behaviors when a sensor is rotated. +Has two variants: with `compatible = "zmk,behavior-sensor-rotate"` it accepts no parameters when used, whereas with `compatible = "zmk,behavior-sensor-rotate-var"` it accepts two parameters. + +See the [sensor rotation behavior](../behaviors/sensor-rotate.md) documentation for more details and examples. + +### Devicetree + +Definition files: + +- [zmk/app/dts/bindings/behaviors/zmk,behavior-sensor-rotate.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-sensor-rotate.yaml) +- [zmk/app/dts/bindings/behaviors/zmk,behavior-sensor-rotate-var.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-sensor-rotate-var.yaml) + +| Property | Type | Description | Default | +| ----------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| `compatible` | string | Sensor rotation type, **must be _one_ of**:
• `"zmk,behavior-sensor-rotate"`
• `"zmk,behavior-sensor-rotate-var"` | | +| `#sensor-binding-cells` | int | Number of params accepted (depends on `compatible` property), **must be _one_ of**:
• `<0>`
• `<2>` | | +| `bindings` | phandle array | A list of two behaviors to trigger for each rotation direction, must include parameters for `"zmk,behavior-sensor-rotate"` and exclude them for `"zmk,behavior-sensor-rotate-var"` | | +| `tap-ms` | int | The tap duration (between press and release events) in milliseconds for behaviors in `bindings` | 5 | + ## Sticky Key Creates a custom behavior that triggers a behavior and keeps it pressed it until another key is pressed and released.