From 84670b5e7a7d7bc92da4a7ed5a525e8823969127 Mon Sep 17 00:00:00 2001 From: JJGadgets Date: Thu, 14 Mar 2024 06:56:49 +0000 Subject: [PATCH] feat(sweep): layer lock, move num layer keys --- config/cradio.keymap | 92 +++++++++++++++++++++++++++++++++----------- 1 file changed, 70 insertions(+), 22 deletions(-) diff --git a/config/cradio.keymap b/config/cradio.keymap index bc08bb9..47a96ff 100644 --- a/config/cradio.keymap +++ b/config/cradio.keymap @@ -11,15 +11,24 @@ // Layers name to integer definition #define DEFAULT 0 -#define NUM 1 -#define NAVI 2 -#define FN 3 -#define TERM 4 +#define NUM_KEYS 1 +#define NUM 2 +#define NUM_LOCK 3 +#define NAVI 4 +#define FN 5 +#define TERM 6 // macro layers -#define MK 5 -#define MF 6 -#define MFG 7 -#define MT 8 +#define MK 7 +#define MF 8 +#define MFG 9 +#define MT 10 + +#define EMPTYLAYER < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans +> &mt { bindings = <&sk>, <&kp>; @@ -28,7 +37,12 @@ quick-release; }; < { - require-prior-idle-ms = <100>; + tapping-term-ms = <280>; + quick-tap-ms = <175>; + require-prior-idle-ms = <150>; +}; +&caps_word { + continue-list = ; }; / { @@ -45,6 +59,18 @@ bindings = <&mmsc>, <&kp APOSTROPHE>; mods = <(MOD_RALT)>; }; + /omit-if-no-ref/ mmgrave: mod_morph_grave { + compatible = "zmk,behavior-mod-morph"; + #binding-cells = <0>; + bindings = <&kp TILDE>, <&kp GRAVE>; + mods = <(MOD_LSFT)>; + }; + /omit-if-no-ref/ mmqgr: mod_morph_q_grave { + compatible = "zmk,behavior-mod-morph"; + #binding-cells = <0>; + bindings = <&kp Q>, <&mmgrave>; + mods = <(MOD_RALT)>; + }; /omit-if-no-ref/ mmat: mod_morph_a_tab { compatible = "zmk,behavior-mod-morph"; #binding-cells = <0>; @@ -72,13 +98,20 @@ tapping-term-ms = <200>; bindings = <&kp>, <&key_repeat>; }; - /omit-if-no-ref/ mto: mod_tap_to { + /omit-if-no-ref/ mto: mod_tap_to_layer { compatible = "zmk,behavior-hold-tap"; #binding-cells = <2>; flavor = "hold-preferred"; tapping-term-ms = <200>; bindings = <&sk>, <&to>; }; + /omit-if-no-ref/ mtog: mod_tap_toggle_layer { + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + flavor = "hold-preferred"; + tapping-term-ms = <200>; + bindings = <&sk>, <&tog>; + }; /omit-if-no-ref/ lt2: layer_tap_2 { compatible = "zmk,behavior-hold-tap"; #binding-cells = <2>; @@ -96,17 +129,18 @@ compatible = "zmk,behavior-hold-tap"; #binding-cells = <2>; flavor = "tap-preferred"; - tapping-term-ms = <150>; - require-prior-idle-ms = <75>; + tapping-term-ms = <280>; + quick-tap-ms = <175>; + require-prior-idle-ms = <150>; bindings = <&mo>, <&mmzd>; }; /omit-if-no-ref/ hm: homerow_mods { compatible = "zmk,behavior-hold-tap"; #binding-cells = <2>; + flavor = "tap-preferred"; tapping-term-ms = <280>; quick-tap-ms = <175>; require-prior-idle-ms = <150>; - flavor = "tap-preferred"; bindings = <&kp>, <&kp>; }; }; @@ -116,7 +150,7 @@ bindings = < //╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮ //│ Q │ W │ F │ P │ G │ │ J │ L │ U │ Y │ ;:'" │ - &kp Q &kp W &kp F &kp P &kp G &kp J &kp L &kp U &kp Y &mmsa + &mmqgr &kp W &kp F &kp P &kp G &kp J &kp L &kp U &kp Y &mmsa //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ //│ A │ R │ S │ T │ D │ │ H │ N │ E │ I │ O │ &mmat &kp R &kp S &kp T < TERM D &kp H &kp N &kp E &kp I &kp O @@ -133,27 +167,29 @@ num_layer { bindings = < //╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮ - //│ `~ │ 1 │ 2 │ 3 │ =+ │ │ '" │ [{ │ ]} │ \| │ BSPC │ - &kp GRAVE &kp N1 &kp N2 &kp N3 &kp EQUAL &kp APOS &kp LBKT &kp RBKT &kp BSLH &kp BSPC + //│ `~ │ 1 │ 2 │ 3 │ \| │ │ [{ │ ]} │ -_ │ =+ │ '" │ + &mmgrave &kp N1 &kp N2 &kp N3 &kp BSLH &kp LBKT &kp RBKT &kp MINUS &kp EQUAL &kp APOS //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ //│ TAB │ 4 │ 5 │ 6 │ 0 │ │ TAB │ LEFT │ DOWN │ UP │ RIGHT │ - &kp TAB &kp N4 &kp N5 &kp N6 &kp N0 &kp TAB &kp LEFT &kp DOWN &kp UP &kp RIGHT + &kp TAB &kp N4 &kp N5 &kp N6 &kp LC(LA(DEL)) &kp TAB &kp LEFT &kp DOWN &kp UP &kp RIGHT //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ - //│ DELETE │ 7 │ 8 │ 9 │ -_ │ │ PSCRN │ HOME │ PG_UP │ PG_DN │ END │ - &kp DEL &kp N7 &kp N8 &kp N9 &kp MINUS &kp PSCRN &kp HOME &kp PG_UP &kp PG_DN &kp END + //│ DELETE │ 7 │ 8 │ 9 │ 0 │ │ PSCRN │ HOME │ PG_UP │ PG_DN │ END │ + &kp DEL &kp N7 &kp N8 &kp N9 &kp N0 &kp PSCRN &kp HOME &kp PG_UP &kp PG_DN &kp END //╰──────────┴──────────┴──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┴──────────┴──────────╯ - &mto LCTRL 0 &mt LSHFT SPACE &mt RALT ENTER < FN ESC + &mtog LCTRL NUM_LOCK &mt LSHFT SPACE &mt RALT ENTER &to FN // ╰──────────┴──────────╯ ╰──────────┴──────────╯ >; }; + num_hold_layer { bindings = EMPTYLAYER; }; + num_lock_layer { bindings = EMPTYLAYER; }; navi_layer { bindings = < //╭──────────┬──────────┬──────────┬──────────┬──────────╮ ╭──────────┬──────────┬──────────┬──────────┬──────────╮ //│ `~ESC │ PREV SONG│PLAY/PAUSE│ NEXT SONG│ PSCRN │ │ │ │ │ │ │ - &gresc &kp C_PREV &kp C_PP &kp C_NEXT &kp PSCRN &trans &trans &bt BT_CLR &bt BT_CLR_ALL &trans + &gresc &kp C_PREV &kp C_PP &kp C_NEXT &kp PSCRN &kp C_MUTE &kp C_VOL_DN &kp C_VOL_UP &kp C_BRI_DN &kp C_BRI_UP //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ //│ LEFT │ DOWN │ UP │ RIGHT │ Num Layer│ │ │TODO:BTDSC│ │ │ │ - &kp LEFT &kp DOWN &kp UP &kp RIGHT &to FN &out OUT_TOG &trans &bt BT_PRV &bt BT_NXT &ext_power EP_TOG + &kp LEFT &kp DOWN &kp UP &kp RIGHT &to FN &out OUT_TOG &bt BT_CLR &bt BT_PRV &bt BT_NXT &ext_power EP_TOG //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ //│ HOME │ PG_DN │ PG_UP │ END │ │ │ │ │ │ │ │ &kp HOME &kp PG_DN &kp PG_UP &kp END &trans &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 @@ -273,4 +309,16 @@ 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 ZMK_MACRO(tech, bindings = <&kp J &kp J &kp G &kp A &kp D &kp G &kp E &kp T &kp S &kp KP_DOT &kp T &kp E &kp C &kp H &to 0>;) }; + conditional_layers { + compatible = "zmk,conditional-layers"; + // layer lock + num_hold { + if-layers = ; + then-layer = ; + }; + num_lock { + if-layers = ; + then-layer = ; + }; + }; };