Skip to content

Commit

Permalink
move behaviors to a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonoff committed Aug 15, 2024
1 parent 1e933b7 commit 4c50262
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
21 changes: 21 additions & 0 deletions config/custom_behavior.dtsi
Original file line number Diff line number Diff line change
@@ -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
};
};
26 changes: 1 addition & 25 deletions config/splitkb_aurora_corne.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include "custom_behavior.dtsi"

#define COL 0
#define QWR 1
Expand Down Expand Up @@ -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
};
};

0 comments on commit 4c50262

Please sign in to comment.