-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
150 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
/* | ||
* Copyright (c) 2022 Christian Eiden | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/bt.h> | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <dt-bindings/zmk/outputs.h> | ||
|
||
#define DEFAULT 0 | ||
#define LOWER 1 | ||
#define RAISE 2 | ||
#define ADJUST 3 | ||
#define BTAB LS(TAB) | ||
#define RADEL RAISE DEL | ||
#define LSPC LSHFT SPACE | ||
#define LENT LCMD ENTER | ||
#define RENT RCMD ENTER | ||
#define RSPC RSHFT SPACE | ||
#define LOBSP LOWER BSPC | ||
|
||
&caps_word { continue-list = <UNDERSCORE MINUS DEL BSPC LSHFT RSHFT>; }; | ||
|
||
/ { | ||
// enable ADJUST Layer | ||
// conditional_layers { | ||
// compatible = "zmk,conditional-layers"; | ||
// tri_layer { | ||
// if-layers = <LOWER RAISE>; | ||
// then-layer = <ADJUST>; | ||
// }; | ||
// }; | ||
|
||
behaviors { | ||
// used for SPACE/SHIFT and ENTER/CMD | ||
|
||
omt: own_mod_tap { | ||
compatible = "zmk,behavior-hold-tap"; | ||
label = "OWN_MOD_TAP"; | ||
#binding-cells = <2>; | ||
flavor = "tap-preferred"; | ||
tapping-term-ms = <350>; | ||
quick-tap-ms = <200>; | ||
bindings = <&kp>, <&kp>; | ||
}; | ||
|
||
// used for Layers/BSPC/DEL | ||
|
||
olt: own_layer_tap { | ||
compatible = "zmk,behavior-hold-tap"; | ||
label = "OWN_LAYER_TAP"; | ||
#binding-cells = <2>; | ||
flavor = "hold-preferred"; | ||
tapping-term-ms = <160>; | ||
quick-tap-ms = <200>; | ||
bindings = <&mo>, <&kp>; | ||
}; | ||
|
||
/* | ||
- tap: sticky shift | ||
- double-tap: caps-word (shift + tap mod-morph) | ||
- hold: shift | ||
From: https://github.com/urob/zmk-config/ | ||
*/ | ||
|
||
smart_shift: smart_shift { | ||
label = "SMART_SHIFT"; | ||
compatible = "zmk,behavior-mod-morph"; | ||
bindings = <&sk RIGHT_SHIFT>, <&caps_word>; | ||
|
||
mods = <(MOD_RSFT)>; | ||
#binding-cells = <0>; | ||
}; | ||
|
||
/* | ||
- tap: backspace | ||
- hold: repeat backspace | ||
- shift + tap: delete | ||
- shift + hold: repeat delete | ||
From: https://zmk.dev/docs/behaviors/mod-morph#advanced-configuration | ||
*/ | ||
|
||
bkspc_del: backspace_delete { | ||
label = "BACKSPACE_DELETE"; | ||
compatible = "zmk,behavior-mod-morph"; | ||
bindings = <&kp BACKSPACE>, <&kp DELETE>; | ||
|
||
mods = <(MOD_LSFT|MOD_RSFT)>; | ||
#binding-cells = <0>; | ||
}; | ||
}; | ||
|
||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
bindings = < | ||
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS | ||
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp EQUAL | ||
&kp LSHIFT &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMICOLON &kp SQT | ||
&kp ESCAPE &kp Z &kp X &omt LC(C) C &omt LC(V) V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH &kp KP_ENTER | ||
&mo 1 &kp BACKSPACE &mt LEFT_WIN RETURN &mt RIGHT_GUI ENTER &kp SPACE &mo 2 | ||
&kp LCTRL &kp LALT &sk RIGHT_SHIFT &mo 3 | ||
>; | ||
}; | ||
|
||
lower_layer { | ||
bindings = < | ||
&kp TILDE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 | ||
&trans &kp LC(LG(LEFT)) &kp LC(LG(RIGHT)) &kp LBKT &kp RBKT &kp PIPE &kp PLUS &kp HASH &kp DLLR &kp PRCNT &kp BACKSLASH &kp F12 | ||
&trans &kp EXCL &kp AT &kp LPAR &kp RPAR &kp UNDER &kp MINUS &kp FSLH &kp STAR &kp TILDE &kp GRAVE &kp UNDER | ||
&trans &kp LT &kp GT &kp LBRC &kp RBRC &kp BACKSLASH &kp EQUAL &kp AMPS &kp PIPE &kp CARET &none &none | ||
&trans &kp DEL &trans &trans &trans &trans | ||
&trans &trans &trans &trans | ||
>; | ||
}; | ||
|
||
raise_layer { | ||
bindings = < | ||
&kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 | ||
&trans &none &none &kp LBKT &kp RBKT &kp PLUS &kp PLUS &kp HOME &kp UP &kp END &none &kp F12 | ||
&trans &kp EXCL &kp AT &kp LPAR &kp RPAR &kp UNDER &kp MINUS &kp LEFT &kp DOWN &kp RIGHT &kp GRAVE &kp UNDER | ||
&trans &kp LESS_THAN &kp GREATER_THAN &kp LBRC &kp RBRC &kp EQUAL &kp EQUAL &kp PAGE_UP &none &kp PAGE_DOWN &trans &trans | ||
&trans &trans &trans &trans &trans &trans | ||
&trans &trans &trans &trans | ||
>; | ||
}; | ||
|
||
adjust_layer { | ||
bindings = < | ||
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &none &out OUT_BLE | ||
&bt BT_NXT &none &none &none &kp C_NEXT &kp C_VOL_UP &kp C_VOLUME_UP &kp KP_NUMBER_7 &kp KP_NUMBER_8 &kp KP_NUMBER_9 &none &out OUT_USB | ||
&bt BT_PRV &none &none &none &kp C_PREVIOUS &kp C_VOL_DN &kp C_VOL_DN &kp KP_NUMBER_4 &kp KP_NUMBER_5 &kp KP_NUMBER_6 &none &none | ||
&none &none &none &none &kp C_PLAY_PAUSE &kp C_MUTE &kp KP_N0 &kp KP_NUMBER_1 &kp KP_NUMBER_2 &kp KP_NUMBER_3 &none &none | ||
&trans &trans &trans &trans &trans &kp BACKSPACE | ||
&trans &trans &trans &trans | ||
>; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters