diff options
author | Pete Johanson <peter@peterjohanson.com> | 2020-07-22 11:08:52 -0400 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2020-07-22 14:54:18 -0400 |
commit | 34ff6190bd6177705bed075c5d52f54e87930591 (patch) | |
tree | b6f96edd1296bdc18a3226729571097bf0bbaed2 /app/dts | |
parent | 4d73938cb5fd5e9b8d94d4e775fd8fba7eb83e3c (diff) |
Initial behavior for key presses on encoder rotate
Diffstat (limited to 'app/dts')
-rw-r--r-- | app/dts/behaviors.dtsi | 3 | ||||
-rw-r--r-- | app/dts/behaviors/sensor_rotate_key_press.dtsi | 19 | ||||
-rw-r--r-- | app/dts/bindings/behaviors/zmk,behavior-sensor-rotate-key-press.yaml | 22 |
3 files changed, 43 insertions, 1 deletions
diff --git a/app/dts/behaviors.dtsi b/app/dts/behaviors.dtsi index 86cd7b7..3978479 100644 --- a/app/dts/behaviors.dtsi +++ b/app/dts/behaviors.dtsi @@ -2,4 +2,5 @@ #include <behaviors/transparent.dtsi> #include <behaviors/mod_tap.dtsi> #include <behaviors/momentary_layer.dtsi> -#include <behaviors/reset.dtsi>
\ No newline at end of file +#include <behaviors/reset.dtsi> +#include <behaviors/sensor_rotate_key_press.dtsi>
\ No newline at end of file diff --git a/app/dts/behaviors/sensor_rotate_key_press.dtsi b/app/dts/behaviors/sensor_rotate_key_press.dtsi new file mode 100644 index 0000000..ef52fba --- /dev/null +++ b/app/dts/behaviors/sensor_rotate_key_press.dtsi @@ -0,0 +1,19 @@ +#include <dt-bindings/zmk/keys.h> + +/ { + behaviors { + enckp: behavior_sensor_rotate_key_press { + compatible = "zmk,behavior-sensor-rotate-key-press"; + label = "ENC_KEY_PRESS"; + usage_page = <USAGE_KEYPAD>; + #sensor-binding-cells = <2>; + }; + + enccp: behavior_sensor_rotate_consumer_press { + compatible = "zmk,behavior-sensor-rotate-key-press"; + label = "ENC_CONSUMER_PRESS"; + usage_page = <USAGE_CONSUMER>; + #sensor-binding-cells = <2>; + }; + }; +}; diff --git a/app/dts/bindings/behaviors/zmk,behavior-sensor-rotate-key-press.yaml b/app/dts/bindings/behaviors/zmk,behavior-sensor-rotate-key-press.yaml new file mode 100644 index 0000000..bbf3537 --- /dev/null +++ b/app/dts/bindings/behaviors/zmk,behavior-sensor-rotate-key-press.yaml @@ -0,0 +1,22 @@ +# Copyright (c) 2020, Pete Johanson +# SPDX-License-Identifier: MIT + +description: Sensor rotate key press/release behavior + +compatible: "zmk,behavior-sensor-rotate-key-press" + +properties: + label: + type: string + required: true + "#sensor-binding-cells": + type: int + required: true + const: 2 + usage_page: + type: int + default: 0 + +sensor-binding-cells: + - param1 + - param2 |