From d207c3c30f7f2d0648b32d59f481498fe048230c Mon Sep 17 00:00:00 2001 From: KemoNine Date: Tue, 29 Dec 2020 11:57:49 -0500 Subject: (feature) Add &to keycode/behavior (#489) feat(behaviors): Add `&to` behavior to switch to a layer. --- app/dts/behaviors.dtsi | 1 + app/dts/behaviors/to_layer.dtsi | 15 +++++++++++++++ app/dts/bindings/behaviors/zmk,behavior-to-layer.yaml | 8 ++++++++ 3 files changed, 24 insertions(+) create mode 100644 app/dts/behaviors/to_layer.dtsi create mode 100644 app/dts/bindings/behaviors/zmk,behavior-to-layer.yaml (limited to 'app/dts') diff --git a/app/dts/behaviors.dtsi b/app/dts/behaviors.dtsi index 9a64fc6..daa073f 100644 --- a/app/dts/behaviors.dtsi +++ b/app/dts/behaviors.dtsi @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/app/dts/behaviors/to_layer.dtsi b/app/dts/behaviors/to_layer.dtsi new file mode 100644 index 0000000..b09616f --- /dev/null +++ b/app/dts/behaviors/to_layer.dtsi @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +/ { + behaviors { + to: behavior_to_layer { + compatible = "zmk,behavior-to-layer"; + label = "TO_LAYER"; + #binding-cells = <1>; + }; + }; +}; diff --git a/app/dts/bindings/behaviors/zmk,behavior-to-layer.yaml b/app/dts/bindings/behaviors/zmk,behavior-to-layer.yaml new file mode 100644 index 0000000..cbafddf --- /dev/null +++ b/app/dts/bindings/behaviors/zmk,behavior-to-layer.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +description: To Layer + +compatible: "zmk,behavior-to-layer" + +include: one_param.yaml -- cgit v1.2.3