mirror of
https://github.com/dnlbauer/sofle-zmk-config.git
synced 2026-09-10 14:35:30 +00:00
275 lines
18 KiB
Plaintext
275 lines
18 KiB
Plaintext
/*
|
|
* Copyright (c) 2020 The ZMK Contributors
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include <behaviors.dtsi>
|
|
#include <dt-bindings/zmk/keys.h>
|
|
#include <dt-bindings/zmk/bt.h>
|
|
#include <dt-bindings/zmk/ext_power.h>
|
|
#include <dt-bindings/zmk/outputs.h>
|
|
|
|
#define DEFAULT 0
|
|
#define SPEC 1
|
|
#define NAV 2
|
|
#define ADJUST 3
|
|
|
|
&caps_word {
|
|
continue-list = <UNDERSCORE MINUS LS(MINUS) UP DOWN LEFT RIGHT BSPC DEL>;
|
|
};
|
|
|
|
// encoder resolution
|
|
&left_encoder {
|
|
resolution = <4>;
|
|
};
|
|
&right_encoder {
|
|
resolution = <4>;
|
|
};
|
|
|
|
// faster layertap
|
|
< {
|
|
quick-tap-ms = <0>;
|
|
tapping-term-ms = <150>;
|
|
};
|
|
|
|
/ {
|
|
conditional_layers {
|
|
compatible = "zmk,conditional-layers";
|
|
tri_layer {
|
|
if-layers = <SPEC NAV>;
|
|
then-layer = <ADJUST>;
|
|
};
|
|
};
|
|
|
|
behaviors {
|
|
tdrstl: tdrstl {
|
|
compatible = "zmk,behavior-tap-dance";
|
|
label = "tdrstl";
|
|
#binding-cells = <0>;
|
|
tapping-term-ms = <200>;
|
|
bindings = <&kp F5>, <&reset>;
|
|
};
|
|
|
|
tdblclear: tdblclear {
|
|
compatible = "zmk,behavior-tap-dance";
|
|
label = "tdblclear";
|
|
#binding-cells = <0>;
|
|
tapping-term-ms = <200>;
|
|
bindings = <&trans>, <&bt BT_CLR>;
|
|
};
|
|
|
|
tdrstr: tdrstr {
|
|
compatible = "zmk,behavior-tap-dance";
|
|
label = "tdrstr";
|
|
#binding-cells = <0>;
|
|
tapping-term-ms = <200>;
|
|
bindings = <&kp F6>, <&reset>;
|
|
};
|
|
|
|
tdcaps: tdcaps {
|
|
compatible = "zmk,behavior-tap-dance";
|
|
label = "tdcaps";
|
|
#binding-cells = <0>;
|
|
tapping-term-ms = <200>;
|
|
bindings = <&caps_word>, <&kp CAPS>;
|
|
};
|
|
|
|
tdctrlcap: tdctrlcap {
|
|
compatible = "zmk,behavior-tap-dance";
|
|
label = "tapdance ctrl/capsword";
|
|
#binding-cells = <0>;
|
|
tapping-term-ms = <200>;
|
|
bindings = <&kp LCTRL>, <&caps_word>;
|
|
};
|
|
|
|
tdtognav: tdtognav {
|
|
compatible = "zmk,behavior-tap-dance";
|
|
label = "tapdance toggle NAV layer";
|
|
#binding-cells = <0>;
|
|
tapping-term-ms = <200>;
|
|
bindings = << NAV BSPC>, <&tog NAV>;
|
|
};
|
|
};
|
|
|
|
macros {
|
|
ud_grave: ud_grave {
|
|
label = "UNDEAD_GRAVE";
|
|
compatible = "zmk,behavior-macro";
|
|
#binding-cells = <0>;
|
|
wait-ms = <10>;
|
|
tap-ms = <10>;
|
|
bindings = <&kp GRAVE &kp SPACE>;
|
|
};
|
|
|
|
ud_tilde: ud_tilde {
|
|
label = "UNDEAD_TILDE";
|
|
compatible = "zmk,behavior-macro";
|
|
#binding-cells = <0>;
|
|
wait-ms = <10>;
|
|
tap-ms = <10>;
|
|
bindings = <&kp TILDE &kp SPACE>;
|
|
};
|
|
|
|
ud_sqt: ud_sqt {
|
|
label = "UNDEAD_SINGLE_QUOTE";
|
|
compatible = "zmk,behavior-macro";
|
|
#binding-cells = <0>;
|
|
wait-ms = <10>;
|
|
tap-ms = <10>;
|
|
bindings = <&kp SQT &kp SPACE>;
|
|
};
|
|
|
|
ud_caret: ud_caret {
|
|
label = "UNDEAD_CARET";
|
|
compatible = "zmk,behavior-macro";
|
|
#binding-cells = <0>;
|
|
wait-ms = <10>;
|
|
tap-ms = <10>;
|
|
bindings = <&kp CARET &kp SPACE>;
|
|
};
|
|
|
|
win_left: win_left {
|
|
label = "WINDOWS LEFT";
|
|
compatible = "zmk,behavior-macro";
|
|
#binding-cells = <0>;
|
|
wait-ms = <10>;
|
|
tap-ms = <10>;
|
|
bindings
|
|
= <¯o_press &kp LGUI>
|
|
, <¯o_tap &kp LEFT>
|
|
, <¯o_release &kp LGUI>;
|
|
};
|
|
|
|
win_right: win_right {
|
|
label = "WINDOWS RIGHT";
|
|
compatible = "zmk,behavior-macro";
|
|
#binding-cells = <0>;
|
|
wait-ms = <10>;
|
|
tap-ms = <10>;
|
|
bindings
|
|
= <¯o_press &kp LGUI>
|
|
, <¯o_tap &kp RIGHT>
|
|
, <¯o_release &kp LGUI>;
|
|
};
|
|
|
|
win_up: win_up {
|
|
label = "WINDOWS UP";
|
|
compatible = "zmk,behavior-macro";
|
|
#binding-cells = <0>;
|
|
wait-ms = <10>;
|
|
tap-ms = <10>;
|
|
bindings
|
|
= <¯o_press &kp LGUI>
|
|
, <¯o_tap &kp UP>
|
|
, <¯o_release &kp LGUI>;
|
|
};
|
|
|
|
};
|
|
|
|
keymap {
|
|
compatible = "zmk,keymap";
|
|
|
|
default_layer {
|
|
label = "Default";
|
|
|
|
bindings = <
|
|
// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | MAGIC |
|
|
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp RS(RC(RA(F12)))
|
|
// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// | TAB | Q | W | E | R | T | | Y | U | I | O | P | BKSPC |
|
|
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC
|
|
// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// | CTRL / CAPSW | A | S | D | F | G | | H | J | K | L | ; | ' |
|
|
&tdctrlcap &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &ud_sqt
|
|
// _______________________________________________________________________________________________ ______________________________________________________________________________________________
|
|
// | SHIFT / { | Z | X | C | V | B | MUTE | | PLAY/PAUSE | N | M | , | . | / | SHIFT / } |
|
|
&mt LSHFT LBRC &kp Z &kp X &kp C &kp V &kp B &kp C_MUTE &kp C_PP &kp N &kp M &kp COMMA &kp DOT &kp FSLH &mt RSHFT RBRC
|
|
// _______________________________________________________________________________________________ ______________________________________________________________________________________________
|
|
// | | GUI | ALT | SPECIAL | ENTER | | SPACE | NAV | ALT | GUI | |
|
|
&trans &kp LGUI &kp LALT < SPEC ESC &kp SPACE &tdtognav < NAV BSPC &kp RALT &kp RGUI &trans
|
|
// ___________________________________________________________________ __________________________________________________________________
|
|
>;
|
|
|
|
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp C_NEXT C_PREV>;
|
|
};
|
|
|
|
special_layer {
|
|
label = "Special";
|
|
|
|
bindings = <
|
|
// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// | | F1 | F2 | F3 | F4 | F5 / reset | | F6 | F7 | F8 | F9 | F10 | F11 |
|
|
&trans &kp F1 &kp F2 &kp F3 &kp F4 &tdrstl &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11
|
|
// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// | | / | | | | + | | ! | @ | # | $ | % | |
|
|
&trans &kp SLASH &trans &trans &trans &kp PLUS &kp EXCL &kp AT &kp HASH &kp DOLLAR &kp PRCNT &trans
|
|
// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// | ` | | | | | = | | ^ | & | * | ( | ) | ~ |
|
|
&ud_grave &trans &trans &trans &trans &kp EQUAL &ud_caret &kp AMPS &kp STAR &kp LPAR &kp RPAR &ud_tilde
|
|
// _______________________________________________________________________________________________ ______________________________________________________________________________________________
|
|
// | SHIFT | * | | | | - | | | | [ | ] | _ | | | \ | |
|
|
&trans &kp STAR &trans &trans &trans &kp MINUS &trans &trans &kp LBKT &kp RBKT &kp UNDER &kp PIPE &kp BSLH &trans
|
|
// _______________________________________________________________________________________________ ______________________________________________________________________________________________
|
|
// | | | | | | | | | | | |
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
// ___________________________________________________________________ __________________________________________________________________
|
|
>;
|
|
|
|
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp C_NEXT C_PREV>;
|
|
};
|
|
|
|
nav_layer {
|
|
label = "Numb/Nav";
|
|
|
|
bindings = <
|
|
// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// | | | | | | | | / reset | | | | | |
|
|
&trans &kp F1 &kp F2 &kp F3 &kp F4 &tdrstl &tdrstr &kp F7 &kp F8 &kp F9 &kp F10 &kp F11// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// | ALT+F4 | / | 7 | 8 | 9 | + | | PG UP | LA(LEFT) | PRINT | LA(RIGHT) | HOME | |
|
|
&kp LA(F4) &kp SLASH &kp N7 &kp N8 &kp N9 &kp PLUS &kp PG_UP &kp LA(LEFT) &kp PSCRN &kp LA(RIGHT) &kp HOME &trans
|
|
// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// | | 0 | 1 | 2 | 3 | = | | LEFT | DOWN | UP | RIGHT | DEL | BACKSPACE |
|
|
&trans &kp N0 &kp N1 &kp N2 &kp N3 &kp EQUAL &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp DEL &kp BSPC
|
|
// _______________________________________________________________________________________________ ______________________________________________________________________________________________
|
|
// | | * | 4 | 5 | 6 | - | | | | PG DOWN | LG(LEFT) | LG(UP) | LG(RIGHT) | END | |
|
|
&trans &kp STAR &kp N4 &kp N5 &kp N6 &kp MINUS &trans &trans &kp PG_DN &win_left &win_up &win_right &kp END &trans
|
|
// _______________________________________________________________________________________________ ______________________________________________________________________________________________
|
|
// | | | | | | | | | | | |
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
// ___________________________________________________________________ __________________________________________________________________
|
|
>;
|
|
|
|
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp C_NEXT C_PREV>;
|
|
};
|
|
|
|
adjust_layer {
|
|
label = "Adjust";
|
|
|
|
bindings = <
|
|
// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// | BLT Clear | BLT0 | BLT1 | BLT2 | BLT3 | BLT4 | | | | | | | |
|
|
&tdblclear &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans
|
|
// | | | | | | | | | | | | | |
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
// _______________________________________________________________________________ ______________________________________________________________________________
|
|
// | | | | | | | | | | | | | |
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
// _______________________________________________________________________________________________ ______________________________________________________________________________________________
|
|
// | | | | | VCC | BLT/CABLE | | | | | | | | | |
|
|
&trans &trans &trans &trans &ext_power EP_TOG &out OUT_TOG &trans &trans &trans &trans &trans &trans &trans &trans
|
|
// _______________________________________________________________________________________________ ______________________________________________________________________________________________
|
|
// | | | | | | | | | | | |
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
// ___________________________________________________________________ __________________________________________________________________
|
|
>;
|
|
|
|
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp C_NEXT C_PREV>;
|
|
};
|
|
|
|
|
|
};
|
|
};
|