feat(behaviors): &key_repeat behavior + tests.

* Add new `&key_repeat` behavior that captures and re-sends
  the most recently triggered keycode.

Closes: #853
This commit is contained in:
Peter Johanson
2021-11-29 04:26:22 +00:00
committed by Pete Johanson
parent ac3c3170bd
commit 70bb7c9334
16 changed files with 278 additions and 0 deletions

View File

@@ -15,3 +15,4 @@
#include <behaviors/ext_power.dtsi>
#include <behaviors/outputs.dtsi>
#include <behaviors/caps_word.dtsi>
#include <behaviors/key_repeat.dtsi>

View File

@@ -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>;
};
};
};

View File

@@ -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