From 1084a8ddab02b0822250e7206783aa68e5624ff9 Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Mon, 9 Dec 2024 14:32:34 -0700 Subject: [PATCH] fixup! docs: Add initial pointer docs. --- docs/docs/config/behaviors.md | 20 +++++++++++++++++++ .../docs/keymaps/behaviors/mouse-emulation.md | 9 ++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/docs/docs/config/behaviors.md b/docs/docs/config/behaviors.md index 527d73c6bae..b564079b72f 100644 --- a/docs/docs/config/behaviors.md +++ b/docs/docs/config/behaviors.md @@ -282,3 +282,23 @@ Applies to: `compatible = "zmk,behavior-tap-dance"` | `#binding-cells` | int | Must be `<0>` | | | `bindings` | phandle array | A list of behaviors from which to select | | | `tapping-term-ms` | int | The maximum time (in milliseconds) between taps before an item from `bindings` is triggered. | 200 | + +## Two Axis Input + +This behavior is part of the core [pointing devices](../features/pointing.md) feature, and is used to generate X/Y and scroll input events. It is the underlying behavior used for the mouse [move](../keymaps/behaviors/mouse-emulation.md#mouse-move) and [scroll](../keymaps/behaviors/mouse-emulation.md#mouse-scroll) behaviors. + +### Devicetree + +Definition file: [zmk/app/dts/bindings/behaviors/zmk,behavior-input-two-axis.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-input-two-axis.yaml) + +Applies to: `compatible = "zmk,behavior-input-two-axis"` + +| Property | Type | Description | Default | +| ----------------------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| `#binding-cells` | int | Must be `<1>` | | +| `x-input-code` | int | The [relative event code](https://github.com/zmkfirmware/zephyr/blob/v3.5.0%2Bzmk-fixes/include/zephyr/dt-bindings/input/input-event-codes.h#L245) for generated input events for the X-axis. | | +| `y-input-code` | int | The [relative event code](https://github.com/zmkfirmware/zephyr/blob/v3.5.0%2Bzmk-fixes/include/zephyr/dt-bindings/input/input-event-codes.h#L245) for generated input events for the Y-axis. | | +| `trigger-period-ms` | int | How many milliseconds between generated input events based on the current speed/direction. | 16 | +| `delay-ms` | int | How many milliseconds to delay any processing or event generation when first pressed. | 0 | +| `time-to-max-speed-ms` | int | How many milliseconds it takes to accelerate to the curren max speed. | 0 | +| `acceleration-exponent` | int | The acceleration exponent to apply: `0` - uniform speed, `1` - uniform acceleration, `2` - exponential acceleration | 1 | diff --git a/docs/docs/keymaps/behaviors/mouse-emulation.md b/docs/docs/keymaps/behaviors/mouse-emulation.md index 9f86cc0c8d4..f2c51dbf85a 100644 --- a/docs/docs/keymaps/behaviors/mouse-emulation.md +++ b/docs/docs/keymaps/behaviors/mouse-emulation.md @@ -180,7 +180,7 @@ If you want to apply any [input processors](../input-processors/index.md#input-p } ``` -### Advanced Configuration +## Advanced Configuration Both `&mmv` and `&msc` are instances of the same `"zmk,behavior-input-two-axis"` behavior. As such, the following settings can be applied to either behavior, e.g.: @@ -193,9 +193,4 @@ Both `&mmv` and `&msc` are instances of the same `"zmk,behavior-input-two-axis"` }; ``` -| Property | Description | -| ----------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `trigger-period-ms` | How many milliseconds between generated input events based on the current speed/direction. | -| `delay-ms` | How many milliseconds to delay any processing or event generation when first pressed. | -| `time-to-max-speed-ms` | How many milliseconds it takes to accelerate to the curren max speed. | -| `acceleration-exponent` | The acceleration exponent to apply: `0` - uniform speed, `1` - uniform acceleration, `2` - exponential acceleration | +See the [two axis input behavior](../../config/behaviors.md#two-axis-input) configuration page for details.