From 25b8a309f42d6eac1a8ce0d3436078a6831de423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Dessureault?= Date: Thu, 23 May 2024 22:34:54 -0400 Subject: [PATCH] chore: use explicit macros from zmk-helpers@v2 --- behaviors/hold-tap.dtsi | 18 +++---- behaviors/macros.dtsi | 12 ++--- behaviors/mod-morph.dtsi | 24 ++++----- behaviors/mouse.dtsi | 2 +- layouts/canadian-multilingual-standard.dtsi | 55 ++++++++++----------- 5 files changed, 55 insertions(+), 56 deletions(-) diff --git a/behaviors/hold-tap.dtsi b/behaviors/hold-tap.dtsi index 27ba0c9..fe3ad15 100644 --- a/behaviors/hold-tap.dtsi +++ b/behaviors/hold-tap.dtsi @@ -17,7 +17,7 @@ /* https://github.com/urob/zmk-config#timeless-homerow-mods */ /* left-hand HRMs */ -ZMK_BEHAVIOR(hml, hold_tap, +ZMK_HOLD_TAP(hml, flavor = "balanced"; tapping-term-ms = <280>; quick-tap-ms = <175>; @@ -28,7 +28,7 @@ ZMK_BEHAVIOR(hml, hold_tap, ) /* right-hand HRMs */ -ZMK_BEHAVIOR(hmr, hold_tap, +ZMK_HOLD_TAP(hmr, flavor = "balanced"; tapping-term-ms = <280>; quick-tap-ms = <175>; @@ -39,7 +39,7 @@ ZMK_BEHAVIOR(hmr, hold_tap, ) // homerow mods for circumflex -ZMK_BEHAVIOR(hrmc, hold_tap, +ZMK_HOLD_TAP(hrmc, flavor = "balanced"; tapping-term-ms = ; quick-tap-ms = ; @@ -48,7 +48,7 @@ ZMK_BEHAVIOR(hrmc, hold_tap, ) // homerow mods for grave -ZMK_BEHAVIOR(hrmg, hold_tap, +ZMK_HOLD_TAP(hrmg, flavor = "balanced"; tapping-term-ms = ; quick-tap-ms = ; @@ -57,7 +57,7 @@ ZMK_BEHAVIOR(hrmg, hold_tap, ) // homerow mods for è -ZMK_BEHAVIOR(hrme, hold_tap, +ZMK_HOLD_TAP(hrme, flavor = "balanced"; tapping-term-ms = ; quick-tap-ms = ; @@ -66,7 +66,7 @@ ZMK_BEHAVIOR(hrme, hold_tap, ) // homerow mods for è -ZMK_BEHAVIOR(hrmeg, hold_tap, +ZMK_HOLD_TAP(hrmeg, flavor = "balanced"; tapping-term-ms = ; quick-tap-ms = ; @@ -75,7 +75,7 @@ ZMK_BEHAVIOR(hrmeg, hold_tap, ) // homerow mods for ê -ZMK_BEHAVIOR(hrmec, hold_tap, +ZMK_HOLD_TAP(hrmec, flavor = "balanced"; tapping-term-ms = ; quick-tap-ms = ; @@ -84,7 +84,7 @@ ZMK_BEHAVIOR(hrmec, hold_tap, ) // homerow mods for î (QWERTY) -ZMK_BEHAVIOR(hrmiq, hold_tap, +ZMK_HOLD_TAP(hrmiq, flavor = "balanced"; tapping-term-ms = ; quick-tap-ms = ; @@ -93,7 +93,7 @@ ZMK_BEHAVIOR(hrmiq, hold_tap, ) // homerow mods for î (Colemak) -ZMK_BEHAVIOR(hrmic, hold_tap, +ZMK_HOLD_TAP(hrmic, flavor = "balanced"; tapping-term-ms = ; quick-tap-ms = ; diff --git a/behaviors/macros.dtsi b/behaviors/macros.dtsi index 69b614f..c9ee107 100644 --- a/behaviors/macros.dtsi +++ b/behaviors/macros.dtsi @@ -7,41 +7,41 @@ #pragma once // Fat arrow padded with spaces: ' => ' -ZMK_BEHAVIOR(FAT_ARROW, macro, bindings = +ZMK_MACRO(FAT_ARROW, bindings = <&kp SPACE &kp EQUAL>, <&kp RA(DOT)>, <&kp SPACE>; ) // Thin arrow padded with spaces: ' -> ' -ZMK_BEHAVIOR(ARROW, macro, bindings = +ZMK_MACRO(ARROW, bindings = <&kp SPACE &kp MINUS>, <&kp RA(DOT)>, <&kp SPACE>; ) // Greater than or equal to: ' >= ' -ZMK_BEHAVIOR(GTE, macro, bindings = +ZMK_MACRO(GTE, bindings = <&kp SPACE>, <&kp GRTHAN>, <&kp EQUAL>, <&kp SPACE>; ) // Less than or equal to: ' <= ' -ZMK_BEHAVIOR(LTE, macro, bindings = +ZMK_MACRO(LTE, bindings = <&kp SPACE>, <&kp LETHAN>, <&kp EQUAL>, <&kp SPACE>; ) // Tmux command: TMUX + ; -ZMK_BEHAVIOR(TMUX_CMD, macro, bindings = +ZMK_MACRO(TMUX_CMD, bindings = <&kp TMUX>, <&kp LS(SEMI)>; ) // Tmux new session: TMUX + ; + new -s + SPACE -ZMK_BEHAVIOR(TMUX_SESSION, macro, bindings = +ZMK_MACRO(TMUX_SESSION, bindings = <&kp TMUX>, <&kp LS(SEMI)>, <&kp N &kp E &kp W &kp SPACE &kp MINUS &kp S &kp SPACE>; diff --git a/behaviors/mod-morph.dtsi b/behaviors/mod-morph.dtsi index 32c4db8..370cf53 100644 --- a/behaviors/mod-morph.dtsi +++ b/behaviors/mod-morph.dtsi @@ -5,73 +5,73 @@ #include "../config/constants.h" // tap: backspace | shift + tap: delete -ZMK_BEHAVIOR(bspc_del, mod_morph, +ZMK_MOD_MORPH(bspc_del, bindings = <&kp BSPC>, <&kp DEL>; mods = <(MOD_LSFT|MOD_RSFT)>; ) // tap: backspace | shift + tap: delete | hold: nav layer -ZMK_BEHAVIOR(bs_del_nav, mod_morph, +ZMK_MOD_MORPH(bs_del_nav, bindings = << NAV BSPC>, <&kp DEL>; mods = <(MOD_LSFT|MOD_RSFT)>; ) // tap: plus | shift + tap: minus -ZMK_BEHAVIOR(plus_minus, mod_morph, +ZMK_MOD_MORPH(plus_minus, bindings = <&kp PLUS>, <&kp MINUS>; mods = <(MOD_LSFT|MOD_RSFT)>; ) // tap: multiply | shift + tap: divide -ZMK_BEHAVIOR(multi_div, mod_morph, +ZMK_MOD_MORPH(multi_div, bindings = <&kp STAR>, <&kp FSLH>; mods = <(MOD_LSFT|MOD_RSFT)>; ) // tap: dash | shift + tap: tilde -ZMK_BEHAVIOR(dash_tilde, mod_morph, +ZMK_MOD_MORPH(dash_tilde, bindings = <&kp MINUS>, <&kp TILDS>; mods = <(MOD_LSFT|MOD_RSFT)>; ) // tap: comma | shift + tap: period -ZMK_BEHAVIOR(comma_dot, mod_morph, +ZMK_MOD_MORPH(comma_dot, bindings = <&kp COMMA>, <&kp DOT>; mods = <(MOD_LSFT|MOD_RSFT)>; ) // hold: num layer | tap: escape | shift OR ctrl + tap : mouse click -ZMK_BEHAVIOR(num_esc_clk, mod_morph, +ZMK_MOD_MORPH(num_esc_clk, bindings = << NUM ESC>, <&mkp LCLK>; mods = <(MOD_LSFT|MOD_LCTL)>; ) // hold: symbol layer | tap: space | shift + tap: non-breaking space -ZMK_BEHAVIOR(sp_nbsp_sym, mod_morph, +ZMK_MOD_MORPH(sp_nbsp_sym, bindings = << SYM SPACE>, <&kp RALT(SPACE)>; mods = <(MOD_LSFT)>; ) // tap: period | shift + tap: colon -ZMK_BEHAVIOR(dot_col, mod_morph, +ZMK_MOD_MORPH(dot_col, bindings = <&kp DOT>, <&kp COLON>; mods = <(MOD_LSFT|MOD_RSFT)>; ) // tap: comma | shift + tap: semi-colon -ZMK_BEHAVIOR(comma_semi, mod_morph, +ZMK_MOD_MORPH(comma_semi, bindings = <&kp COMMA>, <&kp SEMI>; mods = <(MOD_LSFT|MOD_RSFT)>; ) // tap: trema | shift + tap: grave -ZMK_BEHAVIOR(trem_gr, mod_morph, +ZMK_MOD_MORPH(trem_gr, bindings = <&KPD ACC_TR ERG>, <&KPD ACC_GR ERG>; mods = <(MOD_LSFT|MOD_RSFT)>; ) // tap: single apostrophe | shift + tap: double apostrophe -ZMK_BEHAVIOR(sap_dap, mod_morph, +ZMK_MOD_MORPH(sap_dap, bindings = <&kp SAPOS>, <&kp DAPOS>; mods = <(MOD_LSFT|MOD_RSFT)>; ) diff --git a/behaviors/mouse.dtsi b/behaviors/mouse.dtsi index ede27e2..b39e815 100644 --- a/behaviors/mouse.dtsi +++ b/behaviors/mouse.dtsi @@ -39,7 +39,7 @@ #define mwh_dn msc SCRL_DOWN // Switch move/scroll on Ploopy Nano by pressing NumLock twice -ZMK_BEHAVIOR(mwh_tg, macro, bindings = +ZMK_MACRO(mwh_tg, bindings = <¯o_tap_time 1>, <¯o_wait_time 18>, <&kp KP_NUMLOCK &kp KP_NUMLOCK>; diff --git a/layouts/canadian-multilingual-standard.dtsi b/layouts/canadian-multilingual-standard.dtsi index 89af39e..cbc2319 100644 --- a/layouts/canadian-multilingual-standard.dtsi +++ b/layouts/canadian-multilingual-standard.dtsi @@ -31,52 +31,51 @@ #define ACC_TR LS(LBKT) // ¨ // The following must return to the base layer after being pressed -ZMK_BEHAVIOR(A_GR, macro_one_param, bindings = <&kp BACKSLASH>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // À -ZMK_BEHAVIOR(A_CI, macro_one_param, bindings = <&fr_a_cf>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) //  -ZMK_BEHAVIOR(E_CU, macro_one_param, bindings = <&kp SLASH>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // É -ZMK_BEHAVIOR(E_GR, macro_one_param, bindings = <&kp APOS>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // È -ZMK_BEHAVIOR(E_CI, macro_one_param, bindings = <&fr_e_cf>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ê -ZMK_BEHAVIOR(I_CI, macro_one_param, bindings = <&fr_i_cf>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Î -ZMK_BEHAVIOR(O_CI, macro_one_param, bindings = <&fr_o_cf>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ô -ZMK_BEHAVIOR(U_CI, macro_one_param, bindings = <&fr_u_cf>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Û -ZMK_BEHAVIOR(U_GR, macro_one_param, bindings = <&fr_u_gr>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ù -ZMK_BEHAVIOR(AE_L, macro_one_param, bindings = <&fr_ae>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Æ -ZMK_BEHAVIOR(OE_L, macro_one_param, bindings = <&fr_oe>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Œ -ZMK_BEHAVIOR(CEDIL, macro_one_param, bindings = <&kp RBKT>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ç +ZMK_MACRO_ONE_PARAM(A_GR, bindings = <&kp BACKSLASH>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // À +ZMK_MACRO_ONE_PARAM(A_CI, bindings = <&fr_a_cf>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) //  +ZMK_MACRO_ONE_PARAM(E_CU, bindings = <&kp SLASH>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // É +ZMK_MACRO_ONE_PARAM(E_GR, bindings = <&kp APOS>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // È +ZMK_MACRO_ONE_PARAM(E_CI, bindings = <&fr_e_cf>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ê +ZMK_MACRO_ONE_PARAM(I_CI, bindings = <&fr_i_cf>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Î +ZMK_MACRO_ONE_PARAM(O_CI, bindings = <&fr_o_cf>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ô +ZMK_MACRO_ONE_PARAM(U_CI, bindings = <&fr_u_cf>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Û +ZMK_MACRO_ONE_PARAM(U_GR, bindings = <&fr_u_gr>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ù +ZMK_MACRO_ONE_PARAM(AE_L, bindings = <&fr_ae>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Æ +ZMK_MACRO_ONE_PARAM(OE_L, bindings = <&fr_oe>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Œ +ZMK_MACRO_ONE_PARAM(CEDIL, bindings = <&kp RBKT>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ç // QWERTY Homerow Mods -ZMK_BEHAVIOR(E_GR_D, macro, bindings = <&kp APOS>, <&to QWE>;) // È -ZMK_BEHAVIOR(I_CI_D, macro, bindings = <&fr_i_cf>, <&to QWE>;) // Î +ZMK_MACRO(E_GR_D, bindings = <&kp APOS>, <&to QWE>;) // È +ZMK_MACRO(I_CI_D, bindings = <&fr_i_cf>, <&to QWE>;) // Î // Colemak Homerow Mods -ZMK_BEHAVIOR(E_GR_C, macro, bindings = <&kp APOS>, <&to COL>;) // È -ZMK_BEHAVIOR(I_CI_C, macro, bindings = <&fr_i_cf>, <&to COL>;) // Î +ZMK_MACRO(E_GR_C, bindings = <&kp APOS>, <&to COL>;) // È +ZMK_MACRO(I_CI_C, bindings = <&fr_i_cf>, <&to COL>;) // Î // Ergo-L Homerow Mods -ZMK_BEHAVIOR(E_CI_E, macro, bindings = <&fr_e_cf>, <&to ERG>;) // Ê - +ZMK_MACRO(E_CI_E, bindings = <&fr_e_cf>, <&to ERG>;) // Ê // ` directly -ZMK_BEHAVIOR(GRA, macro, bindings = +ZMK_MACRO(GRA, bindings = <¯o_press &kp RALT>, <¯o_tap &kp LBKT &kp LBKT>, <¯o_release &kp RALT>; ) // ^ directly -ZMK_BEHAVIOR(CAR, macro, bindings = +ZMK_MACRO(CAR, bindings = <¯o_tap &kp LBKT &kp SPACE>; ) // ¨ directly -ZMK_BEHAVIOR(TREMA, macro_one_param, bindings = +ZMK_MACRO_ONE_PARAM(TREMA, bindings = <¯o_tap &kp LS(LBKT) &kp SPACE>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>; ) // ` to input -ZMK_BEHAVIOR(AGRA, macro_two_param, bindings = +ZMK_MACRO_TWO_PARAM(AGRA, bindings = <&kp RA(LBKT)>, <¯o_param_1to1>, <¯o_tap &kp MACRO_PLACEHOLDER>, @@ -85,7 +84,7 @@ ZMK_BEHAVIOR(AGRA, macro_two_param, bindings = ) // ` to input then to default layer -ZMK_BEHAVIOR(AGRA_D, macro_one_param, bindings = +ZMK_MACRO_ONE_PARAM(AGRA_D, bindings = <&kp RA(LBKT)>, <¯o_param_1to1>, <¯o_tap &kp MACRO_PLACEHOLDER>, @@ -93,7 +92,7 @@ ZMK_BEHAVIOR(AGRA_D, macro_one_param, bindings = ) // ´ to input -ZMK_BEHAVIOR(AIGU, macro_two_param, bindings = +ZMK_MACRO_TWO_PARAM(AIGU, bindings = <&kp RA(SLASH)>, <¯o_param_1to1>, <¯o_tap &kp MACRO_PLACEHOLDER>, @@ -102,7 +101,7 @@ ZMK_BEHAVIOR(AIGU, macro_two_param, bindings = ) // ¨ to input -ZMK_BEHAVIOR(TREM, macro_two_param, bindings = +ZMK_MACRO_TWO_PARAM(TREM, bindings = <&kp LS(LBKT)>, <¯o_param_1to1>, <¯o_tap &kp MACRO_PLACEHOLDER>, @@ -111,7 +110,7 @@ ZMK_BEHAVIOR(TREM, macro_two_param, bindings = ) // ^ to input -ZMK_BEHAVIOR(CIRC, macro_two_param, bindings = +ZMK_MACRO_TWO_PARAM(CIRC, bindings = <&kp LBKT>, <¯o_param_1to1>, <¯o_tap &kp MACRO_PLACEHOLDER>, @@ -120,7 +119,7 @@ ZMK_BEHAVIOR(CIRC, macro_two_param, bindings = ) // ^ to input then to default layer -ZMK_BEHAVIOR(CIRC_D, macro_one_param, bindings = +ZMK_MACRO_ONE_PARAM(CIRC_D, bindings = <&kp LBKT>, <¯o_param_1to1>, <¯o_tap &kp MACRO_PLACEHOLDER>, @@ -128,7 +127,7 @@ ZMK_BEHAVIOR(CIRC_D, macro_one_param, bindings = ) // Keypress then return to default layer -ZMK_BEHAVIOR(KPD, macro_two_param, bindings = +ZMK_MACRO_TWO_PARAM(KPD, bindings = <¯o_param_1to1>, <&kp MACRO_PLACEHOLDER>, <¯o_param_2to1>,