mirror of
https://github.com/tcaxle/zmk-config.git
synced 2024-11-24 00:02:00 +00:00
198 lines
10 KiB
C
198 lines
10 KiB
C
/*
|
|
* Copyright (c) 2020 The ZMK Contributors
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include <behaviors.dtsi>
|
|
#include <dt-bindings/zmk/keys.h>
|
|
|
|
#define BASE 0
|
|
#define LOWER 1
|
|
#define RAISE 2
|
|
#define ADJUST 3
|
|
|
|
/ {
|
|
// Activate ADJUST layer by pressing raise and lower
|
|
|
|
left_encoder: encoder_left {
|
|
compatible = "alps,ec11";
|
|
label = "LEFT_ENCODER";
|
|
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
|
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
|
steps = <80>;
|
|
};
|
|
|
|
right_encoder: encoder_right {
|
|
compatible = "alps,ec11";
|
|
label = "RIGHT_ENCODER";
|
|
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
|
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
|
steps = <80>;
|
|
};
|
|
|
|
sensors {
|
|
compatible = "zmk,keymap-sensors";
|
|
sensors = <&left_encoder &right_encoder>;
|
|
triggers-per-rotation = <20>;
|
|
};
|
|
|
|
conditional_layers { compatible = "zmk,conditional-layers"; };
|
|
|
|
behaviors {
|
|
mtd: mtd {
|
|
compatible = "zmk,behavior-tap-dance";
|
|
label = "Mod-Tap-Dance";
|
|
#binding-cells = <0>;
|
|
bindings = <&mo 2>, <&mo 3>;
|
|
};
|
|
|
|
shift_caps_l: shift_caps_l {
|
|
compatible = "zmk,behavior-tap-dance";
|
|
label = "SHIFT_CAPS_L";
|
|
#binding-cells = <0>;
|
|
bindings = <&mo 5>, <&kp CAPS>;
|
|
};
|
|
|
|
shift_caps_r: shift_caps_r {
|
|
compatible = "zmk,behavior-tap-dance";
|
|
label = "SHIFT_CAPS_R";
|
|
#binding-cells = <0>;
|
|
bindings = <&mo 6>, <&kp CAPS>;
|
|
};
|
|
|
|
hlt: hlt {
|
|
compatible = "zmk,behavior-hold-tap";
|
|
label = "HLT";
|
|
bindings = <&mo>, <&kp>;
|
|
|
|
#binding-cells = <2>;
|
|
tapping-term-ms = <200>;
|
|
flavor = "hold-preferred";
|
|
retro-tap;
|
|
};
|
|
};
|
|
|
|
combos {
|
|
compatible = "zmk,combos";
|
|
|
|
qwerty {
|
|
bindings = <&tog 4>;
|
|
key-positions = <57 58 59>;
|
|
};
|
|
|
|
L_ENTER {
|
|
bindings = <&kp ENTER>;
|
|
key-positions = <14 15>;
|
|
};
|
|
|
|
R_SPACE {
|
|
bindings = <&kp SPACE>;
|
|
key-positions = <20 21>;
|
|
};
|
|
};
|
|
|
|
keymap {
|
|
compatible = "zmk,keymap";
|
|
|
|
base {
|
|
label = "Base";
|
|
|
|
// ------------------------------------------------------------------------------------------------------------
|
|
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
|
|
// | ESC | Q | W | E | R | T | | Y | U | I | O | P | BKSPC |
|
|
// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' |
|
|
// | SHIFT | Z | X | C | V | B | MUTE | | | N | M | , | . | / | SHIFT |
|
|
// | GUI | ALT | CTRL | LOWER| ENTER | | SPACE | RAISE| CTRL | ALT | GUI |
|
|
|
|
bindings = <
|
|
&kp ESCAPE &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 F &kp P &kp G &kp J &kp L &kp U &kp Y &kp SEMI &kp GRAVE
|
|
&kp BSPC &kp A &kp R &kp S &kp T &kp D &kp H &kp N &kp E &kp I &kp O &kp SINGLE_QUOTE
|
|
&shift_caps_l &kp Z &kp X &kp C &kp V &kp B &kp C_MUTE &kp C_PLAY_PAUSE &kp K &kp M &kp COMMA &kp DOT &kp FSLH &shift_caps_r
|
|
&kp LCTRL &kp LEFT_WIN &kp LALT &mtd < 1 SPACE < 1 ENTER &mtd &kp RALT &kp RIGHT_WIN &kp RIGHT_CONTROL
|
|
>;
|
|
|
|
sensor-bindings = <&inc_dec_kp C_VOL_DN C_VOLUME_UP>;
|
|
};
|
|
|
|
mirrored {
|
|
bindings = <
|
|
&kp MINUS &kp N0 &kp N9 &kp N8 &kp N7 &kp N6 &kp N5 &kp N4 &kp N3 &kp N2 &kp N1 &kp ESC
|
|
&kp GRAVE &kp SEMI &kp Y &kp U &kp L &kp J &kp G &kp P &kp F &kp W &kp Q &kp TAB
|
|
&kp SQT &kp O &kp I &kp E &kp N &kp H &kp D &kp T &kp S &kp R &kp A &kp BSPC
|
|
&shift_caps_r &kp FSLH &kp DOT &kp COMMA &kp M &kp K &kp C_PLAY_PAUSE &kp C_MUTE &kp B &kp V &kp C &kp X &kp Z &shift_caps_l
|
|
&kp RCTRL &kp RGUI &kp RALT &trans &trans &trans &trans &kp LALT &kp LGUI &kp LCTRL
|
|
>;
|
|
|
|
label = "Mirrored";
|
|
};
|
|
|
|
mod_a {
|
|
bindings = <
|
|
&kp EQUAL &kp LBKT &kp RBKT &trans &trans &trans &kp F10 &kp F11 &kp F12 &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp EQUAL
|
|
&kp NON_US_HASH &none &none &none &none &none &mt F7 KP_NUMBER_7 &mt F8 KP_NUMBER_8 &mt F9 KP_NUMBER_9 &kp KP_ASTERISK &kp KP_DIVIDE &kp NON_US_HASH
|
|
&kp DELETE &kp INS &kp HOME &kp UP &kp END &kp PG_UP &mt F4 KP_NUMBER_4 &mt F5 KP_NUMBER_5 &mt F6 KP_NUMBER_6 &kp KP_PLUS &kp KP_MINUS &kp DEL
|
|
&trans &kp NUBS &kp LEFT &kp DOWN &kp RIGHT &kp PAGE_DOWN &trans &trans &mt F1 KP_NUMBER_1 &mt F2 KP_NUMBER_2 &mt F3 KP_NUMBER_3 &kp KP_DOT &kp KP_EQUAL &trans
|
|
&trans &trans &trans &trans &trans &trans &trans &kp KP_NUMBER_0 &trans &trans
|
|
>;
|
|
|
|
label = "Mod A";
|
|
};
|
|
|
|
mod_b {
|
|
label = "Mod b";
|
|
|
|
// TODO: Some binds are waiting for shifted keycode support.
|
|
// ------------------------------------------------------------------------------------------------------------
|
|
// | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 |
|
|
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 |
|
|
// | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | |
|
|
// | | = | - | + | { | } | | | | [ | ] | ; | : | \ | |
|
|
// | | | | | | | | | | | |
|
|
|
|
bindings = <
|
|
&kp EQUAL &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp F10 &kp F11 &kp F12 &trans &trans &trans &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp EQUAL
|
|
&kp KP_NUMLOCK &kp KP_DIVIDE &kp KP_MULTIPLY &mt F7 KP_NUMBER_7 &mt F8 KP_NUMBER_8 &mt F9 KP_NUMBER_9 &none &none &none &none &none &kp NON_US_HASH
|
|
&kp DELETE &kp KP_SUBTRACT &kp KP_PLUS &mt F4 KP_NUMBER_4 &mt F5 KP_NUMBER_5 &mt F6 KP_NUMBER_6 &kp PG_UP &kp HOME &kp UP &kp END &kp INS &kp DELETE
|
|
&trans &kp KP_EQUAL &kp KP_DOT &mt F1 KP_NUMBER_1 &mt F2 KP_NUMBER_2 &mt F3 KP_NUMBER_3 &trans &trans &kp PAGE_DOWN &kp LEFT &kp DOWN &kp RIGHT &kp NUBS &trans
|
|
&trans &trans &kp KP_N0 &trans &trans &trans &trans &trans &trans &trans
|
|
>;
|
|
};
|
|
|
|
qwerty {
|
|
bindings = <
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
&trans &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &trans
|
|
&trans &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &trans
|
|
&trans &kp Z &kp X &kp C &kp V &kp B &trans &trans &kp N &kp M &kp COMMA &kp DOT &kp FSLH &trans
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
>;
|
|
|
|
label = "QWERTY";
|
|
};
|
|
|
|
l_shift {
|
|
label = "LSHIFT";
|
|
bindings = <
|
|
&trans &trans &trans &trans &trans &trans &kp LS(N6) &kp LS(N7) &kp LS(N8) &kp LS(N9) &kp LS(N0) &kp LS(MINUS)
|
|
&trans &trans &trans &trans &trans &trans &kp LS(J) &kp LS(L) &kp LS(U) &kp LS(Y) &kp LS(SEMI) &kp LS(GRAVE)
|
|
&trans &trans &trans &trans &trans &trans &kp LS(H) &kp LS(N) &kp LS(E) &kp LS(I) &kp LS(O) &kp LS(SINGLE_QUOTE)
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &kp LS(K) &kp LS(M) &kp LS(COMMA) &kp LS(DOT) &kp LS(FSLH) &trans
|
|
&kp LS(LCTRL) &kp LS(LEFT_WIN) &kp LS(LEFT_ALT) &mtd &trans &trans &mtd &trans &trans &trans
|
|
>;
|
|
};
|
|
|
|
r_shift {
|
|
label = "RSHIFT";
|
|
bindings = <
|
|
&kp RS(ESCAPE) &kp RS(N1) &kp RS(N2) &kp RS(N3) &kp RS(N4) &kp RS(N5) &trans &trans &trans &trans &trans &trans
|
|
&kp RS(TAB) &kp RS(Q) &kp RS(W) &kp RS(F) &kp RS(P) &kp RS(G) &trans &trans &trans &trans &trans &trans
|
|
&trans &kp RS(A) &kp RS(R) &kp RS(S) &kp RS(T) &kp RS(D) &trans &trans &trans &trans &trans &trans
|
|
&trans &kp RS(Z) &kp RS(X) &kp RS(C) &kp RS(V) &kp RS(B) &trans &trans &trans &trans &trans &trans &trans &trans
|
|
&trans &trans &trans &mtd &trans &trans &mtd &kp RS(RIGHT_ALT) &kp RS(RIGHT_WIN) &kp RS(RCTRL)
|
|
>;
|
|
};
|
|
};
|
|
};
|