zmk-config/config/rae_dux.keymap
2022-11-23 12:13:05 -03:00

180 lines
8.5 KiB
Text

/*
* Copyright (c) 2021 The ZMK Contributors
*
* 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>
// #include <dt-bindings/zmk/mouse.h>
#define BASE_L 0
#define BASER_L 1
#define SYM_L 2
#define MOD_L 3
#define NUM_L 4
#define FUN_L 5
#define NAV_L 6
// #define MOUSE_L 5
&lt {
flavor = "tap-preferred";
tapping-term-ms = <150>;
quick-tap-ms = <0>;
};
&sk {
release-after-ms = <2000>;
};
/ {
combos {
compatible = "zmk,combos";
#define COMBO(NAME, BINDINGS, KEYPOS, TIMEOUT) \
combo_##NAME { \
timeout-ms = <TIMEOUT>; \
bindings = <BINDINGS>; \
key-positions = <KEYPOS>; \
};
/* KEY POSITIONS
╭────────────────────╮ ╭────────────────────╮
│ 0 1 2 3 4 │ │ 5 6 7 8 9 │
│ 10 11 12 13 14 │ │ 15 16 17 18 19 │
│ 20 21 22 23 24 │ │ 25 26 27 28 29 │
╰───────╮ 30 31 32 │ │ 33 34 35 ╭───────╯
╰────────────╯ ╰────────────╯ */
//COMBO(colon, &kp COLON, 7 8, 60)
//COMBO(semicolon, &kp SEMI, 27 28, 60)
//COMBO(slash, &kp FSLH, 1 2, 60)
//COMBO(minus, &kp MINUS, 31 32, 100)
//COMBO(underscore, &kp UNDER, 33 34, 100)
//COMBO(equal, &kp EQUAL, 12 23, 100)
COMBO(enter, &kp ENTER, 13 23, 300)
COMBO(escape, &kp ESC, 20 12 13, 300)
COMBO(reset_left, &bootloader, 0 1 2 3, 100)
COMBO(reset_right, &bootloader, 6 7 8 9, 100)
COMBO(caps_word, &caps_word, 20 21 22 13, 180)
};
behaviors {
lhm: left_hand_positional_hold_tap {
compatible = "zmk,behavior-hold-tap";
label = "LEFT_POSITIONAL_HOLD_TAP";
#binding-cells = <2>;
flavor = "tap-preferred";
tapping-term-ms = <150>;
quick-tap-ms = <0>;
bindings = <&kp>, <&kp>;
// hold-trigger-key-positions = <5 6 7 8 9 15 16 17 18 19 25 26 27 28 29 30 31 32 33 34 35>;
// hold-trigger-key-positions = <5 6 7 8 9 10 11 12 13 15 16 17 18 19 25 26 27 28 29 30 31 32 33 34 35>;
};
rhm: right_hand_positional_hold_tap {
compatible = "zmk,behavior-hold-tap";
label = "RIGHT_POSITIONAL_HOLD_TAP";
#binding-cells = <2>;
flavor = "tap-preferred";
tapping-term-ms = <150>;
quick-tap-ms = <0>;
bindings = <&kp>, <&kp>;
// hold-trigger-key-positions = <0 1 2 3 4 10 11 12 13 14 20 21 22 23 24 30 31 32 33 34 35>;
// hold-trigger-key-positions = <0 1 2 3 4 10 11 12 13 14 16 17 18 19 20 21 22 23 24 30 31 32 33 34 35>;
};
conditional_layers {
compatible = "zmk,conditional-layers";
tri_layer {
if-layers = <NUM_L SYM_L>;
then-layer = <FUN_L>;
};
};
};
keymap {
compatible = "zmk,keymap";
base_layer {
bindings = <
// &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
// &lhm LSHFT A &lhm LALT S &lhm LCTRL D &lhm LGUI F &lhm RALT G &rhm RALT H &rhm LGUI J &rhm LCTRL K &rhm LALT L &rhm LSHFT SEMI
// &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SINGLE_QUOTE
// &mo MOD_L &none &none &none &lt NUM_L SPACE &mo SYM_L
&lt SYM_L Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
&lt NUM_L A &kp S &kp D &kp F &kp G &rhm RALT H &rhm LGUI J &rhm LCTRL K &rhm LALT L &rhm LSHFT SEMI
&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SINGLE_QUOTE
&mo MOD_L &mo NAV_L &lt BASER_L SPACE &none &lt NUM_L SPACE &mo SYM_L
>;
};
base_r_layer {
bindings = <
&kp P &kp O &kp I &kp U &kp Y &none &none &none &none &none
&kp SEMI &kp L &kp K &kp J &kp H &none &none &none &none &none
&kp SINGLE_QUOTE &kp DOT &kp COMMA &kp M &kp N &none &none &none &none &none
&trans &none &none &none &none &none
>;
};
sym_layer {
bindings = <
&none &kp GRAVE &kp BSLH &kp FSLH &kp PIPE &none &none &none &none &none
&none &kp EXCLAMATION &kp AT &kp HASH &kp DOLLAR &none &none &none &none &none
&none &kp PERCENT &kp CARET &kp AMPERSAND &kp STAR &none &none &none &none &none
&trans &trans &trans &trans &trans &trans
>;
};
mod_layer {
bindings = <
&none &sk RALT &kp C_VOL_UP &kp C_VOL_DN &kp C_MUTE &none &none &kp TAB &none &bootloader
&sk LSHFT &sk LALT &sk LCTRL &sk LGUI &kp BACKSPACE &kp LEFT &kp DOWN &kp UP &kp RIGHT &none
&out OUT_TOG &bt BT_SEL 3 &bt BT_SEL 2 &bt BT_CLR &kp PRINTSCREEN &kp HOME &kp PG_DN &kp PG_UP &kp END &kp RETURN
&trans &trans &trans &trans &trans &trans
>;
};
num_layer {
bindings = <
&none &kp N7 &kp N8 &kp N9 &kp PLUS &none &none &none &none &none
&none &kp N4 &kp N5 &kp N6 &kp N0 &none &none &none &none &none
&none &kp N1 &kp N2 &kp N3 &kp MINUS &none &none &none &none &none
&trans &trans &trans &trans &trans &trans
>;
};
fun_layer {
bindings = <
&none &none &none &none &none &none &kp F7 &kp F8 &kp F9 &kp F12
&kp LSHFT &kp LALT &kp LCTRL &kp LGUI &kp RALT &none &kp F4 &kp F5 &kp F6 &kp F11
&none &none &none &none &none &none &kp F1 &kp F2 &kp F3 &kp F10
&trans &trans &trans &trans &trans &trans
>;
};
nav_layer {
bindings = <
&kp LCTL &kp PG_UP &kp UP &kp PG_DN &kp LS(TAB) &none &none &none &none &none
&kp LSHFT &kp LEFT &kp DOWN &kp RIGHT &kp TAB &none &none &none &none &none
&kp LALT &kp LG(PG_UP) &kp LG(PG_DN) &none &none &none &none &none &none &none
&trans &trans &trans &none &none &none
>;
};
// mouse_layer {
// bindings = <
// &none &none &none &none &none &none &mkp LCLK &mkp RCLK &none &none
// &kp LSHFT &kp LALT &kp LCTRL &mkp LCLK &mkp RCLK &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_UP &mmv MOVE_RIGHT &none
// &none &none &none &none &none &mmv SCROLL_LEFT &mwh SCROLL_DOWN &mwh SCROLL_UP &mmv SCROLL_RIGHT &none
// &trans &trans &trans &trans &trans &trans
// >;
// };
};
};