Skip to content

Commit

Permalink
feat(sweep): layer lock, move num layer keys
Browse files Browse the repository at this point in the history
  • Loading branch information
JJGadgets authored Mar 14, 2024
1 parent 544ca7e commit 84670b5
Showing 1 changed file with 70 additions and 22 deletions.
92 changes: 70 additions & 22 deletions config/cradio.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand All @@ -28,7 +37,12 @@
quick-release;
};
&lt {
require-prior-idle-ms = <100>;
tapping-term-ms = <280>;
quick-tap-ms = <175>;
require-prior-idle-ms = <150>;
};
&caps_word {
continue-list = <UNDERSCORE MINUS SEMICOLON COLON APOSTROPHE DOUBLE_QUOTES>;
};

/ {
Expand All @@ -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>;
Expand Down Expand Up @@ -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>;
Expand All @@ -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>;
};
};
Expand All @@ -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 &lt TERM D &kp H &kp N &kp E &kp I &kp O
Expand All @@ -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 &lt 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
Expand Down Expand Up @@ -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 = <NUM>;
then-layer = <NUM_KEYS>;
};
num_lock {
if-layers = <NUM_LOCK>;
then-layer = <NUM_KEYS>;
};
};
};

0 comments on commit 84670b5

Please sign in to comment.