Files
sofle-zmk-config/config/sofle.keymap
2023-04-08 20:08:35 +02:00

256 lines
17 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 = <8>;
};
&right_encoder {
resolution = <8>;
};
// faster layertap
&lt {
quick-tap-ms = <0>;
tapping-term-ms = <100>;
};
/ {
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 = <&trans>, <&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>;
};
};
macros {
ud_grave: ud_grave {
label = "UNDEAD_GRAVE";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
wait-ms = <30>;
tap-ms = <40>;
bindings = <&kp GRAVE &kp SPACE>;
};
ud_tilde: ud_tilde {
label = "UNDEAD_TILDE";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
wait-ms = <30>;
tap-ms = <40>;
bindings = <&kp TILDE &kp SPACE>;
};
ud_sqt: ud_sqt {
label = "UNDEAD_SINGLE_QUOTE";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
wait-ms = <30>;
tap-ms = <40>;
bindings = <&kp SQT &kp SPACE>;
};
win_left: win_left {
label = "WINDOWS LEFT";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
wait-ms = <10>;
bindings
= <&macro_press &kp LGUI>
, <&macro_tap &kp LEFT>
, <&macro_release &kp LGUI>;
};
win_right: win_right {
label = "WINDOWS RIGHT";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
wait-ms = <10>;
bindings
= <&macro_press &kp LGUI>
, <&macro_tap &kp RIGHT>
, <&macro_release &kp LGUI>;
};
win_up: win_up {
label = "WINDOWS UP";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
wait-ms = <10>;
bindings
= <&macro_press &kp LGUI>
, <&macro_tap &kp UP>
, <&macro_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 &lt SPEC ESC &kp SPACE &mt RALT RET &lt 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 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
// _______________________________________________________________________________ ______________________________________________________________________________
// | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ |
&ud_grave &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPAR &kp RPAR &ud_tilde
// _______________________________________________________________________________________________ ______________________________________________________________________________________________
// | SHIFT | * | | | | - | | | | [ | ] | _ | | | \ | |
&trans &kp EQUAL &kp MINUS &kp KP_PLUS &kp LBRC &kp RBRC &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 &trans &trans &trans &trans &trans &tdrstr &trans &trans &trans &trans &trans
// _______________________________________________________________________________ ______________________________________________________________________________
// | ALT+F4 | / | 7 | 8 | 9 | + | | PG UP | LA(LEFT) | | LA(RIGHT) | HOME | |
&kp LA(F4) &kp SLASH &kp N7 &kp N8 &kp N9 &kp PLUS &kp PG_UP &kp LA(LEFT) &trans &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 ASTERISK &kp N4 &kp N5 &kp N6 &kp MINUS &trans &trans &kp PG_DN &win_left &win_up &win_right &kp END &trans
// _______________________________________________________________________________________________ ______________________________________________________________________________________________
// | | | . | | | | | | | | |
&trans &trans &kp DOT &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>;
};
};
};