diff --git a/config/cradio.conf b/config/cradio.conf index 0c2600a..a2bbb1f 100644 --- a/config/cradio.conf +++ b/config/cradio.conf @@ -29,3 +29,6 @@ CONFIG_BT_PERIPHERAL_PREF_MAX_INT=6 CONFIG_ZMK_BEHAVIORS_QUEUE_SIZE=512 CONFIG_ZMK_MACRO_DEFAULT_WAIT_MS=35 CONFIG_ZMK_MACRO_DEFAULT_TAP_MS=35 +# Mouse keys +CONFIG_ZMK_MOUSE=y +CONFIG_ZMK_BEHAVIOR_INPUT_TWO_AXIS=y diff --git a/config/cradio.keymap b/config/cradio.keymap index b010428..bcb0764 100644 --- a/config/cradio.keymap +++ b/config/cradio.keymap @@ -25,15 +25,16 @@ #define RNAV 4 #define LNAV 5 #define FN 6 -#define GAME 7 -#define TERM 8 +#define MOUSE 7 +#define GAME 8 +#define TERM 9 // macro layers -#define MK 9 -#define MF 10 -#define MFG 11 -#define MT 12 -#define MGIT 13 -#define LOCK 14 +#define MK 10 +#define MF 11 +#define MFG 12 +#define MT 13 +#define MGIT 14 +#define LOCK 15 #define EMPTYLAYER \ &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans \ @@ -50,7 +51,29 @@ require-prior-idle-ms = <150>; }; &caps_word { - continue-list = ; + continue-list = ; +}; +&num_word { // urob fork only + layers = ; + continue-list = ; +}; + +// mouse keys (copied from urob) +#define ZMK_MOUSE_DEFAULT_MOVE_VAL 1500 // 600 +#define ZMK_MOUSE_DEFAULT_SCRL_VAL 20 // 10 + +#include + +&mmv { + acceleration-exponent = <1>; // 1 + time-to-max-speed-ms = <500>; // 40 + delay-ms = <0>; // 0 +}; + +&msc { + acceleration-exponent = <1>; // 0 + time-to-max-speed-ms = <40>; // 500 + delay-ms = <0>; // 10 }; / { @@ -64,18 +87,22 @@ JJ_MM(mmgrave, mod_morph_grave, mods = <(MOD_LSFT)>; bindings = <&kp TILDE>, <&kp GRAVE>;) JJ_MM(mmqgr, mod_morph_q_grave, mods = <(MOD_RALT)>; bindings = <&kp Q>, <&mmgrave>;) JJ_MM(mmat, mod_morph_a_tab, mods = <(MOD_RALT|MOD_RGUI)>; keep-mods = <(MOD_RALT|MOD_RGUI)>; bindings = <&kp A>, <&kp TAB>;) - JJ_MM(mmcw, mod_morph_caps_word, mods = <(MOD_LSFT)>; bindings = <&kp ESC>, <&caps_word>;) + JJ_MM(mmcw, mod_morph_caps_word, mods = <(MOD_LSFT)>; bindings = <&kp ESC>, <&kp CAPSLOCK>;) JJ_MM(gamespc, mod_morph_gaming_space_caps_word, mods = <(MOD_LSFT)>; bindings = <&kp SPACE>, <&caps_word>;) JJ_HT_HOLD(caps, caps_word_hold, bindings = <&kp>, <&mmcw>;) JJ_HT_HOLD(spc, space_shift, retro-tap; hold-while-undecided; bindings = <&kp>, <&kp>;) JJ_HT_HOLD(rm, repeat_mod, bindings = <&kp>, <&key_repeat>;) - JJ_HT_HOLD(rl, repeat_layer, quick-tap-ms = <175>; bindings = <&mo>, <&key_repeat>;) // allow hold repeat of repeat key + JJ_MM(nl, mod_morph_num_layer, mods = <(MOD_LSFT)>; bindings = <&snl NUM NUM>, <&snlc NUM NUM>;) + JJ_HT_HOLD(snl, smart_num_layer, bindings = <&mo>, <&num_word>;) + JJ_HT_HOLD(snlc, smart_num_layer_caps, bindings = <&mo>, <&caps_word>;) JJ_HT_HOLD(mto, mod_tap_to_layer, bindings = <&sk>, <&to>;) JJ_HT_HOLD(mtog, mod_tap_toggle_layer, bindings = <&sk>, <&tog>;) JJ_HT_HOLD(lt2, layer_tap_2, bindings = <&mo>, <&to>;) JJ_MM(mmzd, mod_morph_z_delete, mods = <(MOD_RALT)>; bindings = <&kp Z>, <&kp DEL>;) JJ_HT_TAP(ltz, layer_tap_z, bindings = <&mo>, <&mmzd>;) JJ_HT_TAP(hm, homerow_mods, bindings = <&kp>, <&kp>;) + JJ_MM(mmbd, mod_morph_backspace_delete, mods = <(MOD_LSFT)>; bindings = <&kp BSPC>, <&kp DEL>;) + JJ_HT_TAP(bd, backspace_delete, bindings = <&kp>, <&mmbd>;) JJ_HML_34(hl, homerow_mods_left, bindings = <&kp>, <&kp>;) JJ_HMR_34(hr, homerow_mods_right, bindings = <&kp>, <&kp>;) JJ_HML_34(hma, homerow_mods_a, bindings = <&kp>, <&mmat>;) // to put shift on homerow, not that I would probably use this a lot but @@ -83,190 +110,6 @@ JJ_TD(numdot, num_layer_dot, <&kp DOT>, <&none>, <&kp LC(LA(DEL))>, <&tog GAME>) JJ_MM(mmctrlspc, mod_morph_ctrl_space, mods = <(MOD_LSFT)>; bindings = <&kp SPACE>, <&kp LCTRL>;) }; - combos { - compatible = "zmk,combos"; - game_ctrl { - timeout-ms = CSLOW; - key-positions = <31 10>; // left outer thumb + A (default) or G (gaming) - bindings = <&kp LCTRL>; - layers = ; - }; - game_ctrl2 { - timeout-ms = CSLOW; - key-positions = <30 10>; // left outer thumb + A (default) or G (gaming) - bindings = <&kp LCTRL>; - layers = ; - }; - game_d { - timeout-ms = CSLOW; - key-positions = <31 14>; // left outer thumb + D (default) or T (gaming) - bindings = <&kp D>; - layers = ; - }; - combo_grave { - timeout-ms = CFAST; - key-positions = <0 1>; // Q + W - bindings = <&mmgrave>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_layer_num { - timeout-ms = CSLOW; - key-positions = <11 12 13>; // R + S + T - bindings = <&tog NUM_LOCK>; - layers = <0 LNUM NUM_LOCK>; - require-prior-idle-ms = ; - }; - combo_tab { - timeout-ms = CFAST; - key-positions = <10 11>; // A + R - bindings = <&kp TAB>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_delete { - timeout-ms = CFAST; - key-positions = <20 21>; // Z + X - bindings = <&kp DEL>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_enter { - timeout-ms = CSLOW; - key-positions = <16 17 18>; // N + E + I - bindings = <&kp ENTER>; - require-prior-idle-ms = ; - }; - combo_double_quotes { - timeout-ms = CFAST; - key-positions = <8 9>; // Y + : - bindings = <&kp DOUBLE_QUOTES>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_semicolon { - timeout-ms = CFAST; - key-positions = <9 19>; // O + : - bindings = <&kp SEMICOLON>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_left { - timeout-ms = CSLOW; - key-positions = <33 16>; // right outer thumb + O key - bindings = <&kp LEFT>; - layers = <0>; - }; - combo_down { - timeout-ms = CSLOW; - key-positions = <33 17>; // right outer thumb + O key - bindings = <&kp DOWN>; - layers = <0>; - }; - combo_up { - timeout-ms = CSLOW; - key-positions = <33 7>; // right outer thumb + O key - bindings = <&kp UP>; - layers = <0>; - }; - combo_right { - timeout-ms = CSLOW; - key-positions = <33 18>; // right outer thumb + O key - bindings = <&kp RIGHT>; - layers = <0>; - }; - combo_exclamation { - timeout-ms = CFAST; - key-positions = <1 2>; // W + F - bindings = <&kp EXCLAMATION>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_at { - timeout-ms = CFAST; - key-positions = <2 3>; // F + P - bindings = <&kp AT_SIGN>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_hash { - timeout-ms = CFAST; - key-positions = <3 4>; // F + P - bindings = <&kp HASH>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_dollar { - timeout-ms = CFAST; - key-positions = <11 12>; // R + S - bindings = <&kp DOLLAR>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_percent { - timeout-ms = CFAST; - key-positions = <12 13>; // S + T - bindings = <&kp PERCENT>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_caret { - timeout-ms = CFAST; - key-positions = <13 14>; // T + D - bindings = <&kp CARET>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_ampersand { - timeout-ms = CFAST; - key-positions = <21 22>; // X + C - bindings = <&kp AMPERSAND>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_star { - timeout-ms = CFAST; - key-positions = <21 23>; // X + V - bindings = <&kp STAR>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_left_bracket { - timeout-ms = CFAST; - key-positions = <22 23>; // C + V - bindings = <&kp LEFT_PARENTHESIS>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_right_bracket { - timeout-ms = CFAST; - key-positions = <23 24>; // V + B - bindings = <&kp RIGHT_PARENTHESIS>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_pipe { - timeout-ms = CFAST; - key-positions = <5 6>; // J + L - bindings = <&kp PIPE>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_hyphen { - timeout-ms = CFAST; - key-positions = <6 7>; // L + U - bindings = <&kp MINUS>; - layers = <0>; - require-prior-idle-ms = ; - }; - combo_equal { - timeout-ms = CFAST; - key-positions = <7 8>; // U + Y - bindings = <&kp EQUAL>; - layers = <0>; - require-prior-idle-ms = ; - }; - }; keymap { compatible = "zmk,keymap"; default_layer { @@ -281,7 +124,7 @@ //│ Z │ X │ C │ V │ B │ │ K │ M │ ,< │ .> │ /? │ <z FN Z &hl LCTRL X &hl RALT C &hl RGUI V < LNAV B &kp K &hr LGUI M &hr LALT COMMA &hr LCTRL DOT &kp FSLH //╰──────────┴──────────┴──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┴──────────┴──────────╯ - &caps LCTRL ESC &spc LSHFT SPACE &hm MEH(RALT) BSPC &rl NUM R + &caps LCTRL ESC &spc LSHFT SPACE &nl &bd MEH(RALT) BSPC // ╰──────────┴──────────╯ ╰──────────┴──────────╯ // esc gets thumb cuz vim & as safe key to verify layer 0 // mmsa = tap for colon, shift for semicolon, RALT for double quotes, NUM layer for single quotes @@ -291,15 +134,15 @@ bindings = < // TODO: decide whether to split this or not //╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮ //│ `~ │ 1 │ 2 │ 3 │ \| │ │ [{ │ HOME │ UP │ END │ =+ │ - &mmgrave &kp N1 &kp N2 &kp N3 &kp BSLH &kp LBKT &kp HOME &kp UP &kp END &kp EQUAL + &mmgrave &kp N1 &kp N2 &kp N3 &kp BSLH &kp ENTER &kp HOME &hm PG_UP UP &kp END &kp DOUBLE_QUOTES //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ //│ TAB │ 4 │ 5 │ 6 │ . │ │ ]} │ LEFT │ DOWN │ RIGHT │ '" │ - &kp TAB &kp N4 &kp N5 &kp N6 &numdot &kp RBKT &kp LEFT &kp DOWN &kp RIGHT &kp APOS + &kp TAB &kp N4 &kp N5 &kp N6 &numdot &kp TAB &hm HOME LEFT &hm PG_DN DOWN &hm END RIGHT &kp APOS //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ //│ DELETE │ 7 │ 8 │ 9 │ 0 │ │ TAB │ PG_UP │ -_ │ PG_DN │ PSCRN │ - &kp DEL &kp N7 &kp N8 &kp N9 &kp N0 &kp TAB &kp PG_UP &kp MINUS &kp PG_DN &kp PSCRN + &kp DEL &kp N7 &kp N8 &kp N9 &kp N0 &kp LBKT &kp RBKT &kp MINUS &kp EQUAL &kp PSCRN //╰──────────┴──────────┴──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┴──────────┴──────────╯ - &mtog LCTRL NUM_LOCK &mt LSHFT SPACE &mt RALT ENTER &to FN + &mtog LCTRL NUM_LOCK &mt LSHFT SPACE &none &mmbd // ╰──────────┴──────────╯ ╰──────────┴──────────╯ >; }; @@ -353,6 +196,22 @@ // ╰──────────┴──────────╯ ╰──────────┴──────────╯ >; }; + mouse_layer { + bindings = < + //╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮ + //│ `~ │ 1 │ 2 │ 3 │ \| │ │ [{ │ ]} │ -_ │ =+ │ '" │ + &trans &trans &trans &trans &trans &msc SCRL_UP &msc SCRL_LEFT &mmv MOVE_UP &msc SCRL_RIGHT &to 0 + //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ + //│ TAB │ 4 │ 5 │ 6 │ 0 │ │ TAB │ LEFT │ DOWN │ UP │ RIGHT │ + &trans &trans &trans &trans &none &msc SCRL_DOWN &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_RIGHT &kp LSHFT + //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ + //│ DELETE │ 7 │ 8 │ 9 │ 0 │ │ PSCRN │ HOME │ PG_UP │ PG_DN │ END │ + &trans &trans &trans &trans &trans &none &mkp MB1 &mkp MB3 &mkp MB2 &none + //╰──────────┴──────────┴──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┴──────────┴──────────╯ + &to 0 &trans &mkp MB4 &mkp MB5 + // ╰──────────┴──────────╯ ╰──────────┴──────────╯ + >; + }; game_layer { bindings = < // NOTE: This is suited to my gaming habits. @@ -497,6 +356,197 @@ ZMK_MACRO(ke, bindings = <&kp K &kp U &kp B &kp E &kp C &kp T &kp L &kp SPACE &kp E &kp D &kp I &kp T &kp SPACE &kp KP_MINUS &kp N &kp SPACE &kp LEFT &kp LEFT &kp LEFT &kp LEFT &kp SPACE &to 0>;) // kubectl edit -n ZMK_MACRO(kx, bindings = <&kp K &kp U &kp B &kp E &kp C &kp T &kp L &kp SPACE &kp E &kp X &kp E &kp C &kp SPACE &kp KP_MINUS &kp I &kp T &kp SPACE &kp KP_MINUS &kp N &kp SPACE &kp KP_MINUS &kp KP_MINUS &kp SPACE &kp B &kp A &kp S &kp H &kp LEFT &kp LEFT &kp LEFT &kp LEFT &kp LEFT &kp LEFT &kp LEFT &kp LEFT &kp SPACE &to 0>;) // kubectl exec -it -n }; + combos { + compatible = "zmk,combos"; + game_ctrl { + timeout-ms = CSLOW; + key-positions = <31 10>; // left outer thumb + A (default) or G (gaming) + bindings = <&kp LCTRL>; + layers = ; + }; + game_ctrl2 { + timeout-ms = CSLOW; + key-positions = <30 10>; // left outer thumb + A (default) or G (gaming) + bindings = <&kp LCTRL>; + layers = ; + }; + game_d { + timeout-ms = CSLOW; + key-positions = <31 14>; // left outer thumb + D (default) or T (gaming) + bindings = <&kp D>; + layers = ; + }; + combo_grave { + timeout-ms = CFAST; + key-positions = <6 9>; // W + G + bindings = <&tog MOUSE>; + layers = <0 LNUM MOUSE>; + require-prior-idle-ms = ; + }; + combo_grave { + timeout-ms = CFAST; + key-positions = <0 1>; // Q + W + bindings = <&mmgrave>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_layer_num { + timeout-ms = CSLOW; + key-positions = <11 12 13>; // R + S + T + bindings = <&kp TAB>; + layers = <0 LNUM NUM_LOCK>; + require-prior-idle-ms = ; + }; + combo_tab { + timeout-ms = CFAST; + key-positions = <10 11>; // A + R + bindings = <&kp TAB>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_delete { + timeout-ms = CFAST; + key-positions = <20 21>; // Z + X + bindings = <&kp DEL>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_enter { + timeout-ms = CSLOW; + key-positions = <16 17 18>; // N + E + I + bindings = <&kp ENTER>; + require-prior-idle-ms = ; + }; + combo_double_quotes { + timeout-ms = CFAST; + key-positions = <8 9>; // Y + : + bindings = <&kp DOUBLE_QUOTES>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_semicolon { + timeout-ms = CFAST; + key-positions = <9 19>; // O + : + bindings = <&kp SEMICOLON>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_left { + timeout-ms = CSLOW; + key-positions = <33 16>; // right outer thumb + O key + bindings = <&kp LEFT>; + layers = <0>; + }; + combo_down { + timeout-ms = CSLOW; + key-positions = <33 17>; // right outer thumb + O key + bindings = <&kp DOWN>; + layers = <0>; + }; + combo_up { + timeout-ms = CSLOW; + key-positions = <33 7>; // right outer thumb + O key + bindings = <&kp UP>; + layers = <0>; + }; + combo_right { + timeout-ms = CSLOW; + key-positions = <33 18>; // right outer thumb + O key + bindings = <&kp RIGHT>; + layers = <0>; + }; + combo_exclamation { + timeout-ms = CFAST; + key-positions = <1 2>; // W + F + bindings = <&kp EXCLAMATION>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_at { + timeout-ms = CFAST; + key-positions = <2 3>; // F + P + bindings = <&kp AT_SIGN>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_hash { + timeout-ms = CFAST; + key-positions = <3 4>; // F + P + bindings = <&kp HASH>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_dollar { + timeout-ms = CFAST; + key-positions = <11 12>; // R + S + bindings = <&kp DOLLAR>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_percent { + timeout-ms = CFAST; + key-positions = <12 13>; // S + T + bindings = <&kp PERCENT>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_caret { + timeout-ms = CFAST; + key-positions = <13 14>; // T + D + bindings = <&kp CARET>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_ampersand { + timeout-ms = CFAST; + key-positions = <21 22>; // X + C + bindings = <&kp AMPERSAND>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_star { + timeout-ms = CFAST; + key-positions = <21 23>; // X + V + bindings = <&kp STAR>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_left_bracket { + timeout-ms = CFAST; + key-positions = <22 23>; // C + V + bindings = <&kp LEFT_PARENTHESIS>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_right_bracket { + timeout-ms = CFAST; + key-positions = <23 24>; // V + B + bindings = <&kp RIGHT_PARENTHESIS>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_pipe { + timeout-ms = CFAST; + key-positions = <5 6>; // J + L + bindings = <&kp PIPE>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_hyphen { + timeout-ms = CFAST; + key-positions = <6 7>; // L + U + bindings = <&kp MINUS>; + layers = <0>; + require-prior-idle-ms = ; + }; + combo_equal { + timeout-ms = CFAST; + key-positions = <7 8>; // U + Y + bindings = <&kp EQUAL>; + layers = <0>; + require-prior-idle-ms = ; + }; + }; conditional_layers { compatible = "zmk,conditional-layers"; // layer lock diff --git a/config/west.yml b/config/west.yml index b886cbe..952643f 100644 --- a/config/west.yml +++ b/config/west.yml @@ -2,11 +2,13 @@ manifest: remotes: - name: zmkfirmware url-base: https://github.com/zmkfirmware + - name: urob + url-base: https://github.com/urob # Additional modules containing boards/shields/custom code can be listed here as well # See https://docs.zephyrproject.org/3.2.0/develop/west/manifest.html#projects projects: - name: zmk - remote: zmkfirmware + remote: urob # mouse keys, smart layers revision: main import: app/west.yml self: