Skip to content

Commit

Permalink
fixup! docs: Add initial pointer docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Dec 9, 2024
1 parent e25df25 commit 1084a8d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
20 changes: 20 additions & 0 deletions docs/docs/config/behaviors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
9 changes: 2 additions & 7 deletions docs/docs/keymaps/behaviors/mouse-emulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.:

Expand All @@ -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.

0 comments on commit 1084a8d

Please sign in to comment.