diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2023-05-12 16:07:09 -0400 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2023-05-12 16:07:09 -0400 |
commit | 96318f1d793d02faf4b9bfc8552de2b6c8078325 (patch) | |
tree | 826c901df6463a1a53f5180a521b350475b027e0 /config/base.keymap | |
parent | 025d3b647b88c717311a10e7362ba2940cbfaefb (diff) |
update keymaps
Diffstat (limited to 'config/base.keymap')
-rw-r--r-- | config/base.keymap | 202 |
1 files changed, 202 insertions, 0 deletions
diff --git a/config/base.keymap b/config/base.keymap new file mode 100644 index 0000000..bf7d2b4 --- /dev/null +++ b/config/base.keymap @@ -0,0 +1,202 @@ +// -*- mode: dts-mode; tab-width: 2 -*- +#include <behaviors.dtsi> +#include <dt-bindings/zmk/keys.h> +#include <dt-bindings/zmk/bt.h> +#include <dt-bindings/zmk/mouse.h> + +#define DV 0 +#define QW 1 +#define GAMING 2 +#define LOW 3 +#define UPR 4 +#define NAV 5 +#define MOUSE 6 +#define QVLOW 7 +#define GAMELOW 8 +#define FN 9 + +#define SPACEKEY &layer_mo NAV SPACE + +#define HM1(k) hm LGUI k +#define HM2(k) hm LALT k +#define HM3(k) hm LCTL k +#define HM4(k) hm LSHFT k + +#include "extra_keys.h" + +/ { + behaviors { + hm: homerow_modifiers { + label = "hmod"; + compatible = "zmk,behavior-hold-tap"; + flavor = "balanced"; + #binding-cells = <2>; + tapping-term-ms = <280>; + quick-tap-ms = <175>; + global-quick-tap-ms = <150>; + bindings = <&kp>, <&kp>; + hold-trigger-on-release; + }; + layer_mo: layer_modifiers { + label = "layermod"; + compatible = "zmk,behavior-hold-tap"; + flavor = "balanced"; + #binding-cells = <2>; + tapping-term-ms = <280>; + quick-tap-ms = <175>; + global-quick-tap-ms = <150>; + bindings = <&mo>, <&kp>; + hold-trigger-on-release; + }; + /* hm_slow: homerow_mods_slow { */ + /* bincompatible = "zmk,behavior-hold-tap"; */ + /* label = "HMOD_S"; */ + /* #binding-cells = <2>; */ + /* tapping-term-ms = <250>; */ + /* quick-tap-ms = <0>; */ + /* flavor = "tap-preferred"; */ + /* bindings = <&kp>, <&kp>; */ + /* }; */ + /* hm_med: homerow_mods_medium { */ + /* compatible = "zmk,behavior-hold-tap"; */ + /* label = "HMOD_M"; */ + /* #binding-cells = <2>; */ + /* tapping-term-ms = <200>; */ + /* quick-tap-ms = <0>; */ + /* flavor = "tap-preferred"; */ + /* bindings = <&kp>, <&kp>; */ + /* }; */ + /* hm_fast: homerow_mods_fast { */ + /* compatible = "zmk,behavior-hold-tap"; */ + /* label = "HMOD_F"; */ + /* #binding-cells = <2>; */ + /* tapping-term-ms = <160>; */ + /* quick-tap-ms = <0>; */ + /* flavor = "tap-preferred"; */ + /* bindings = <&kp>, <&kp>; */ + /* }; */ + }; + + conditional_layers { + compatible = "zmk,conditional-layers"; + fn_layer { + if-layers = <LOW UPR>; + then-layer = <FN>; + }; + qwlow_layer { + if-layers = <QW LOW>; + then-layer = <QVLOW>; + }; + gamelow_layer { + if-layers = <GAMING LOW>; + then-layer = <GAMELOW>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { + label = "DVORAK"; + // DV - Dvorak layer + bindings = < + R1X &kp SQT &kp COMMA &kp DOT &kp P &kp Y &kp F &kp G &kp C &kp R &kp L R1Z + R2X &HM1(A) &HM2(O) &HM3(E) &HM4(U) &kp I &kp D &HM4(H) &HM3(T) &HM2(N) &HM1(S) R2Z + R3X &kp SEMI &kp Q &kp J &kp K &kp X &kp B &kp M &kp W &kp V &kp Z R3Z + R4X &kp LSHIFT &mo LOW SPACEKEY TX &mo UPR &kp LSHIFT R4Z + >; + }; + + dvorak_layer { + label = "QWERTY"; + // This is a "QWERTY" keymap, but it's really intended to be used in dvorak mode + // (with setxkbmap us -variant dvorak -option compose:ralt). + bindings = < + R1X &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P R1Z + R2X &HM1(A) &HM2(S) &HM3(D) &HM4(F) &kp G &kp H &HM4(J) &HM3(K) &HM2(L) &HM1(SEMI) R2Z + R3X &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH R3Z + R4X &kp LSHIFT &mo LOW SPACEKEY TX &mo UPR &kp LSHIFT R4Z + >; + }; + + gaming_layer { + label = "GAMING"; + bindings = < + R1X &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P R1Z + R2X &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI R2Z + R3X &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH R3Z + + R4X SPACEKEY TX &mo UPR &kp LSHIFT R4Z + >; + }; + + lower_layer { + bindings = < + R1X &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPAR &kp RPAR R1Z + R2X &kp LGUI &kp LALT &kp LCTL &kp LSHFT &kp BSLH &kp FSLH &kp UNDER &kp PLUS &kp LBRC &kp RBRC R2Z + R3X &kp GRAVE &kp TILDE &kp TAB &kp ESC &kp PIPE &kp QMARK &kp MINUS &kp EQUAL &kp LBKT &kp RBKT R3Z + R4X &trans &trans SPACEKEY TX &trans &trans R4Z + >; + }; + + raise_layer { + bindings = < + R1X &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 R1Z + R2X &trans &trans &trans &trans &trans &kp BSPC &kp LSHFT &kp LCTL &kp LALT &kp LGUI R2Z + R3X &trans &trans &trans &trans &trans &kp RALT &kp RET &kp DEL &trans &trans R3Z + + R4X &trans &trans SPACEKEY TX &trans &trans R4Z + >; + }; + + navigation_layer { + bindings = < + R1X &mkp MB4 &mkp MB3 &mkp MB2 &mkp MB1 &trans &trans &trans &trans &trans &trans R1Z + R2X &trans &trans &trans &trans &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT R2Z + R3X &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_DN &kp PG_UP &kp END R3Z + + R4X &trans &trans SPACEKEY TX &trans &trans R4Z + >; + }; + + mouse_layer { + // Waiting for https://github.com/zmkfirmware/zmk/pull/778 + // Using fork at https://github.com/ftc/zmk/blob/mouse-ftc + bindings = < + R1X &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans R1Z + R2X &mkp MB4 &mkp MB3 &mkp MB2 &mkp MB1 &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT R2Z + R3X &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans R3Z + + R4X &trans &trans SPACEKEY TX &trans &trans R4Z + >; + }; + + qwerty_lower_layer { + bindings = < + R1X &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPAR &kp RPAR R1Z + R2X &kp LGUI &kp LALT &kp LCTL &kp LSHFT &kp BSLH &kp LBKT &kp DQT &kp RBRC &kp UNDER &kp PLUS R2Z + R3X &kp GRAVE &kp TILDE &kp TAB &kp ESC &kp PIPE &kp LBRC &kp SQT &kp RBKT &kp MINUS &kp EQUAL R3Z + R4X &trans &trans SPACEKEY TX &trans &trans R4Z + >; + }; + + gaming_lower_layer { + bindings = < + R1X &kp N1 &kp N2 &kp N3 &kp N4 &kp N9 &trans &trans &trans &trans &trans R1Z + R2X &kp N5 &kp N6 &kp N7 &kp N8 &kp N0 &trans &trans &trans &trans &trans R2Z + R3X &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans R3Z + R4X &trans &trans SPACEKEY TX &trans &trans R4Z + >; + }; + + function_layer { + bindings = < + R1X &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 R1Z + R2X &kp F11 &kp F12 &to GAMING &to DV &to QW &trans &trans &trans &trans &trans R2Z + R3X FUNC_KEYS R3Z + R4X &trans &trans SPACEKEY TX &trans &trans R4Z + >; + }; + + }; +}; |