From 3b0311188e5d92235587be20473b94d8e007a71b Mon Sep 17 00:00:00 2001 From: englmaxi Date: Tue, 21 Nov 2023 00:25:01 +0100 Subject: [PATCH] use ZMK_LAYER and ZMK_MACRO --- config/cradio.keymap | 115 ++++++++++---------------------------- keymap-drawer/cradio.svg | 38 ++++++------- keymap-drawer/cradio.yaml | 86 ++++++++++++++-------------- 3 files changed, 90 insertions(+), 149 deletions(-) diff --git a/config/cradio.keymap b/config/cradio.keymap index 20067e7..8773581 100644 --- a/config/cradio.keymap +++ b/config/cradio.keymap @@ -162,148 +162,89 @@ MAKE_HRM(hmr_par_lgt, &kp, &par_lgt, KEYS_L THUMBS) / { macros { - par_macro: par_macro { - compatible = "zmk,behavior-macro"; - #binding-cells = <0>; + ZMK_MACRO(par_macro, bindings = <&kp DE_LPAR &kp DE_RPAR &kp LEFT>; - label = "PAR_MACRO"; - }; + ) - bkt_macro: bkt_macro { - compatible = "zmk,behavior-macro"; - #binding-cells = <0>; + ZMK_MACRO(bkt_macro, bindings = <&kp DE_LBKT &kp DE_RBKT &kp LEFT>; - label = "BKT_MACRO"; - }; + ) - sqt_macro: sqt_macro { - compatible = "zmk,behavior-macro"; - #binding-cells = <0>; + ZMK_MACRO(sqt_macro, bindings = <&kp DE_SQT &kp DE_SQT &kp LEFT>; - label = "SQT_MACRO"; - }; + ) - dqt_macro: dqt_macro { - compatible = "zmk,behavior-macro"; - #binding-cells = <0>; + ZMK_MACRO(dqt_macro, bindings = <&kp DE_DQT &kp DE_DQT>, <¯o_release>, <&kp LSHFT>, <¯o_tap>, <&kp LEFT>; + ) - label = "DQT_MACRO"; - }; - - brc_macro: brc_macro { - compatible = "zmk,behavior-macro"; - #binding-cells = <0>; + ZMK_MACRO(brc_macro, bindings = <&kp DE_LBRC &kp DE_RBRC &kp LEFT>; - label = "BRC_MACRO"; - }; + ) - lgt_macro: lgt_macro { - compatible = "zmk,behavior-macro"; - #binding-cells = <0>; + ZMK_MACRO(lgt_macro, bindings = <&kp DE_LT &kp DE_GT>, <¯o_release>, <&kp LSHFT>, <¯o_tap>, <&kp LEFT>; - - label = "LGT_MACRO"; - }; + ) }; +}; - keymap { - compatible = "zmk,keymap"; +ZMK_CONDITIONAL_LAYER(NAV NUM, HW) - base_layer { - bindings = < +ZMK_LAYER(base_layer, &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp DE_Y &td_sqt_dqt &hml LGUI A &hml LALT R &hml LCTRL S &hml LSHIFT T &kp G &kp M &hmr RSHFT N &hmr LCTRL E &hmr LALT I &hmr LGUI O &kp DE_Z &kp X &kp C < 6 D &kp V &kp K &kp H &kp DE_COMMA &kp DE_DOT &qexcl &mo NAV &mt_td_scw LSHFT 0 < HW SPACE &mo NUM - >; - - label = "DEF"; - }; +) - nav_layer { - bindings = < +ZMK_LAYER(nav_layer, &kp ESC &kp LC(W) &kp LC(F) &kp BSPC &kp INS &trans &kp PG_DN &kp PG_UP &trans &trans &sk LGUI &sk LALT &sk LCTRL &sk LSHFT &sk RALT &ht_home 0 LEFT &ht LC(END) DOWN &ht LC(HOME) UP &ht_end 0 RIGHT &kp PAUSE_BREAK &kp LC(DE_Z) &kp LC(X) &kp LC(INS) &trans &kp LS(INS) &kp RET &ht LC(BSPC) BSPC &kp TAB &ht LC(DEL) DEL &kp PSCRN &trans &trans &trans &trans - >; - - label = "NAV"; - }; +) - num_layer { - bindings = < +ZMK_LAYER(num_layer, &trans &trans &trans &trans &trans &kp DE_DOT &kp N7 &kp N8 &kp N9 &kp BSPC &trans &trans &trans &trans &trans &kp DE_COMMA &kp N4 &kp N5 &kp N6 &kp RET &trans &trans &trans &trans &trans &kp N0 &kp N1 &kp N2 &kp N3 &trans &trans &trans &trans &trans - >; - - label = "NUM"; - }; +) - fun_layer { - bindings = < +ZMK_LAYER(fun_layer, &trans &kp C_VOL_DN &kp C_MUTE &kp C_VOL_UP &kp C_BRI_UP &kp F12 &kp F7 &kp F8 &kp F9 &kp LC(DE_PLUS) &trans &trans &trans &trans &kp C_BRI_DN &kp F11 &kp F4 &kp F5 &kp F6 &kp LC(DE_MINUS) &trans &kp C_PREV &kp C_PP &kp C_NEXT &trans &kp F10 &kp F1 &kp F2 &kp F3 &kp LC(N0) &trans &trans &trans &trans - >; - - label = "FUN"; - }; +) - hw_layer { - bindings = < +ZMK_LAYER(hw_layer, &bootloader &trans &trans &trans &trans &trans &trans &trans &trans &bootloader &trans &trans &out OUT_USB &out OUT_TOG &trans &trans &bt BT_NXT &out OUT_BLE &bt BT_CLR &trans &trans &trans &trans &trans &trans &trans &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &trans &trans &trans &trans &trans - >; - - label = "HW"; - }; +) - ger_layer { - bindings = < +ZMK_LAYER(ger_layer, &trans &trans &trans &trans &trans &trans &trans &kp DE_U_UMLAUT &kp DE_ACUTE &kp DE_GRAVE &kp DE_A_UMLAUT &trans &kp DE_ESZETT &trans &trans &trans &trans &trans &trans &kp DE_O_UMLAUT &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans - >; - - label = "GER"; - }; +) - mouse_layer { - bindings = < +ZMK_LAYER(mouse_layer, &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 &mkp MB4 &mkp MB3 &mkp MB5 &trans &trans &trans &mkp LCLK &mkp RCLK - >; - - label = "MSE"; - }; - }; - - conditional_layers { - compatible = "zmk,conditional-layers"; - - fun_cond { - if-layers = <1 2>; - then-layer = <4>; - }; - }; -}; +) \ No newline at end of file diff --git a/keymap-drawer/cradio.svg b/keymap-drawer/cradio.svg index 3ae6083..29ddc77 100644 --- a/keymap-drawer/cradio.svg +++ b/keymap-drawer/cradio.svg @@ -322,8 +322,8 @@ rect.held, rect.combo.held { translate: 5px -28px; } - -DEF + +base_layer @@ -453,7 +453,7 @@ rect.held, rect.combo.held { D -MSE +mouse_layer @@ -489,7 +489,7 @@ rect.held, rect.combo.held { -NAV +nav_layer @@ -500,12 +500,12 @@ rect.held, rect.combo.held { -HW +hw_layer -NUM +num_layer @@ -519,7 +519,7 @@ rect.held, rect.combo.held { -GER +ger_layer @@ -646,8 +646,8 @@ rect.held, rect.combo.held { - -NAV + +nav_layer @@ -837,8 +837,8 @@ rect.held, rect.combo.held { - -NUM + +num_layer @@ -1035,8 +1035,8 @@ rect.held, rect.combo.held { - -FUN + +fun_layer @@ -1234,8 +1234,8 @@ rect.held, rect.combo.held { - -HW + +hw_layer @@ -1414,8 +1414,8 @@ rect.held, rect.combo.held { - -GER + +ger_layer @@ -1587,8 +1587,8 @@ rect.held, rect.combo.held { - -MSE + +mouse_layer diff --git a/keymap-drawer/cradio.yaml b/keymap-drawer/cradio.yaml index 46102a5..cde57de 100644 --- a/keymap-drawer/cradio.yaml +++ b/keymap-drawer/cradio.yaml @@ -1,6 +1,6 @@ layout: {qmk_keyboard: ferris/sweep} layers: - DEF: + base_layer: - Q - W - F @@ -24,18 +24,18 @@ layers: - Z - X - C - - {t: D, h: MSE} + - {t: D, h: mouse_layer} - V - K - H - ',' - . - {t: '?', s: '!'} - - NAV + - nav_layer - $$mdi:apple-keyboard-shift$$ - - {t: '$$mdi:keyboard-space$$', h: HW} - - NUM - NAV: + - {t: '$$mdi:keyboard-space$$', h: hw_layer} + - num_layer + nav_layer: - ESC - $$mdi:close-box-outline$$ - $$mdi:text-search$$ @@ -70,7 +70,7 @@ layers: - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} - NUM: + num_layer: - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} @@ -105,7 +105,7 @@ layers: - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} - {type: held} - FUN: + fun_layer: - {t: '$$mdi:chevron-down$$', type: trans} - $$mdi:volume-minus$$ - $$mdi:volume-mute$$ @@ -140,7 +140,7 @@ layers: - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} - HW: + hw_layer: - $$mdi:progress-download$$ - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} @@ -175,7 +175,7 @@ layers: - {t: '$$mdi:chevron-down$$', type: trans} - {type: held} - {t: '$$mdi:chevron-down$$', type: trans} - GER: + ger_layer: - {t: '$$mdi:chevron-down$$', type: trans} - {type: held} - {t: '$$mdi:chevron-down$$', type: trans} @@ -210,7 +210,7 @@ layers: - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} - MSE: + mouse_layer: - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} - {t: '$$mdi:chevron-down$$', type: trans} @@ -248,100 +248,100 @@ layers: combos: - p: [1, 2] k: ESC - l: [DEF, FUN, NUM] + l: [base_layer, fun_layer, num_layer] - p: [3, 2] k: $$mdi:keyboard-return$$ - l: [DEF, FUN, NUM] + l: [base_layer, fun_layer, num_layer] - p: [3, 1] - k: {t: GER, h: '$$mdi:circle-small$$'} - l: [DEF] + k: {t: ger_layer, h: '$$mdi:circle-small$$'} + l: [base_layer] a: top o: 0.6 - p: [12, 11] k: $$mdi:keyboard-tab$$ - l: [DEF, FUN, NUM] + l: [base_layer, fun_layer, num_layer] - p: [13, 12] k: $$mdi:repeat$$ - l: [DEF, FUN, NUM] + l: [base_layer, fun_layer, num_layer] - p: [6, 7] k: {t: '[', s: '{'} - l: [DEF] + l: [base_layer] - p: [7, 8] k: {t: ']', s: '}'} - l: [DEF] + l: [base_layer] - p: [6, 8] k: {t: '[]', s: '{ }'} - l: [DEF] + l: [base_layer] a: top o: 0.6 - p: [16, 17] k: {t: (, s: <} - l: [DEF] + l: [base_layer] - p: [17, 18] k: {t: ), s: '>'} - l: [DEF] + l: [base_layer] - p: [16, 18] k: {t: (), s: <>} - l: [DEF] + l: [base_layer] a: bottom o: 1.2 - p: [26, 27] k: $$mdi:backspace-outline$$ - l: [DEF, FUN, NUM] + l: [base_layer, fun_layer, num_layer] - p: [27, 28] k: $$mdi:backspace-reverse-outline$$ - l: [DEF, FUN, NUM] + l: [base_layer, fun_layer, num_layer] - p: [4, 14] k: '%' - l: [DEF] + l: [base_layer] - p: [3, 13] k: $ - l: [DEF] + l: [base_layer] - p: [2, 12] k: '#' - l: [DEF] + l: [base_layer] - p: [1, 11] k: '@' - l: [DEF] + l: [base_layer] - p: [14, 24] k: '~' - l: [DEF] + l: [base_layer] - p: [13, 23] k: '=' - l: [DEF] + l: [base_layer] - p: [12, 22] k: \ - l: [DEF] + l: [base_layer] - p: [11, 21] k: € - l: [DEF] + l: [base_layer] - p: [5, 15] k: ^ - l: [DEF] + l: [base_layer] - p: [6, 16] k: + - l: [DEF] + l: [base_layer] - p: [7, 17] k: '*' - l: [DEF] + l: [base_layer] - p: [8, 18] k: '&' - l: [DEF] + l: [base_layer] - p: [9, 19] k: § - l: [DEF] + l: [base_layer] - p: [15, 25] k: _ - l: [DEF] + l: [base_layer] - p: [16, 26] k: '-' - l: [DEF] + l: [base_layer] - p: [17, 27] k: / - l: [DEF] + l: [base_layer] - p: [18, 28] k: '|' - l: [DEF] + l: [base_layer] - p: [19, 29] k: ° - l: [DEF] + l: [base_layer]