summaryrefslogtreecommitdiff
path: root/app/dts
diff options
context:
space:
mode:
authorPeter Johanson <peter@peterjohanson.com>2021-11-29 04:26:22 +0000
committerPete Johanson <peter@peterjohanson.com>2022-01-30 22:47:34 -0500
commit70bb7c93349344e0990f12282abfcd8d00ba7208 (patch)
treeeeb47ee39ec4a887ef6d1edf809b88709e6269bb /app/dts
parentac3c3170bd70f5186544495cb5ced7bfbf3f6764 (diff)
feat(behaviors): `&key_repeat` behavior + tests.
* Add new `&key_repeat` behavior that captures and re-sends the most recently triggered keycode. Closes: #853
Diffstat (limited to 'app/dts')
-rw-r--r--app/dts/behaviors.dtsi1
-rw-r--r--app/dts/behaviors/key_repeat.dtsi19
-rw-r--r--app/dts/bindings/behaviors/zmk,behavior-key-repeat.yaml13
3 files changed, 33 insertions, 0 deletions
diff --git a/app/dts/behaviors.dtsi b/app/dts/behaviors.dtsi
index 5b5f72b..0648961 100644
--- a/app/dts/behaviors.dtsi
+++ b/app/dts/behaviors.dtsi
@@ -15,3 +15,4 @@
#include <behaviors/ext_power.dtsi>
#include <behaviors/outputs.dtsi>
#include <behaviors/caps_word.dtsi>
+#include <behaviors/key_repeat.dtsi>
diff --git a/app/dts/behaviors/key_repeat.dtsi b/app/dts/behaviors/key_repeat.dtsi
new file mode 100644
index 0000000..aa8ffa0
--- /dev/null
+++ b/app/dts/behaviors/key_repeat.dtsi
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2021 The ZMK Contributors
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#include <dt-bindings/zmk/keys.h>
+
+/ {
+ behaviors {
+ /omit-if-no-ref/ key_repeat: behavior_key_repeat {
+ compatible = "zmk,behavior-key-repeat";
+ label = "KEY_REPEAT";
+ #binding-cells = <0>;
+ usage-pages = <HID_USAGE_KEY>;
+ };
+ };
+};
+
diff --git a/app/dts/bindings/behaviors/zmk,behavior-key-repeat.yaml b/app/dts/bindings/behaviors/zmk,behavior-key-repeat.yaml
new file mode 100644
index 0000000..10b3aa0
--- /dev/null
+++ b/app/dts/bindings/behaviors/zmk,behavior-key-repeat.yaml
@@ -0,0 +1,13 @@
+# Copyright (c) 2021 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+
+description: Key repeat behavior
+
+compatible: "zmk,behavior-key-repeat"
+
+include: zero_param.yaml
+
+properties:
+ usage-pages:
+ type: array
+ required: true