From 4c5026232a9cbda2a089aeebf722aba9c337abb2 Mon Sep 17 00:00:00 2001 From: Simeon Simeonoff Date: Thu, 15 Aug 2024 20:31:10 +0300 Subject: [PATCH] move behaviors to a separate file --- config/custom_behavior.dtsi | 21 +++++++++++++++++++++ config/splitkb_aurora_corne.keymap | 26 +------------------------- 2 files changed, 22 insertions(+), 25 deletions(-) create mode 100644 config/custom_behavior.dtsi diff --git a/config/custom_behavior.dtsi b/config/custom_behavior.dtsi new file mode 100644 index 0000000..3120b9d --- /dev/null +++ b/config/custom_behavior.dtsi @@ -0,0 +1,21 @@ +/ { + behaviors { + ctrl_esc: ctrl_esc { + compatible = "zmk,behavior-hold-tap"; + tap-behavior = <&kp ESC>; // Tap behavior sends Escape + hold-behavior = <&kp LCTRL>; // Hold behavior sends Ctrl + }; + + sym_bspc: sym_bspc { + compatible = "zmk,behavior-hold-tap"; + tap-behavior = <&kp BSPC>; // Tap behavior sends Backspace + hold-behavior = <&mo SYM>; // Hold behavior activates Layer 3 + }; + + swapper: swapper { + compatible = "zmk,behavior-tri-state"; + #binding-cells = <0>; + bindings = <&kt RGUI>, <&kp TAB>, <&kt RGUI>; // Cmd, Tab, and release Cmd + ignored-key-positions = <7 9 16 17 18 19 29>; // Ignore arrows, BSPC, ENTER, DEL + }; +}; diff --git a/config/splitkb_aurora_corne.keymap b/config/splitkb_aurora_corne.keymap index f2cf8bf..f08f92c 100644 --- a/config/splitkb_aurora_corne.keymap +++ b/config/splitkb_aurora_corne.keymap @@ -7,6 +7,7 @@ #include #include #include +#include "custom_behavior.dtsi" #define COL 0 #define QWR 1 @@ -89,28 +90,3 @@ }; }; }; - -&behavior_hold_tap { - ctrl_esc: ctrl_esc { - compatible = "zmk,behavior-hold-tap"; - tap-behavior = <&kp ESC>; // Tap behavior sends Escape - hold-behavior = <&kp LCTRL>; // Hold behavior sends Ctrl - }; -}; - -&behavior_hold_tap { - sym_bspc: sym_bspc { - compatible = "zmk,behavior-hold-tap"; - tap-behavior = <&kp BSPC>; // Tap behavior sends Backspace - hold-behavior = <&mo SYM>; // Hold behavior activates Layer 3 - }; -}; - -&behavior_tri_state { - swapper: swapper { - compatible = "zmk,behavior-tri-state"; - #binding-cells = <0>; - bindings = <&kt RGUI>, <&kp TAB>, <&kt RGUI>; // Cmd, Tab, and release Cmd - ignored-key-positions = <7 9 16 17 18 19 29>; // Ignore arrows, BSPC, ENTER, DEL - }; -};