Skip to content

Commit

Permalink
chore: use explicit macros from zmk-helpers@v2
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffDess committed May 24, 2024
1 parent b9302da commit 25b8a30
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 56 deletions.
18 changes: 9 additions & 9 deletions behaviors/hold-tap.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand All @@ -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>;
Expand All @@ -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 = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
Expand All @@ -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 = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
Expand All @@ -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 = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
Expand All @@ -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 = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
Expand All @@ -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 = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
Expand All @@ -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 = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
Expand All @@ -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 = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
Expand Down
12 changes: 6 additions & 6 deletions behaviors/macros.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
24 changes: 12 additions & 12 deletions behaviors/mod-morph.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <&lt 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 = <&lt 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 = <&lt 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)>;
)
2 changes: 1 addition & 1 deletion behaviors/mouse.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
<&macro_tap_time 1>,
<&macro_wait_time 18>,
<&kp KP_NUMLOCK &kp KP_NUMLOCK>;
Expand Down
55 changes: 27 additions & 28 deletions layouts/canadian-multilingual-standard.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // À
ZMK_BEHAVIOR(A_CI, macro_one_param, bindings = <&fr_a_cf>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Â
ZMK_BEHAVIOR(E_CU, macro_one_param, bindings = <&kp SLASH>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // É
ZMK_BEHAVIOR(E_GR, macro_one_param, bindings = <&kp APOS>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // È
ZMK_BEHAVIOR(E_CI, macro_one_param, bindings = <&fr_e_cf>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ê
ZMK_BEHAVIOR(I_CI, macro_one_param, bindings = <&fr_i_cf>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Î
ZMK_BEHAVIOR(O_CI, macro_one_param, bindings = <&fr_o_cf>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ô
ZMK_BEHAVIOR(U_CI, macro_one_param, bindings = <&fr_u_cf>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Û
ZMK_BEHAVIOR(U_GR, macro_one_param, bindings = <&fr_u_gr>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ù
ZMK_BEHAVIOR(AE_L, macro_one_param, bindings = <&fr_ae>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Æ
ZMK_BEHAVIOR(OE_L, macro_one_param, bindings = <&fr_oe>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Œ
ZMK_BEHAVIOR(CEDIL, macro_one_param, bindings = <&kp RBKT>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ç
ZMK_MACRO_ONE_PARAM(A_GR, bindings = <&kp BACKSLASH>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // À
ZMK_MACRO_ONE_PARAM(A_CI, bindings = <&fr_a_cf>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Â
ZMK_MACRO_ONE_PARAM(E_CU, bindings = <&kp SLASH>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // É
ZMK_MACRO_ONE_PARAM(E_GR, bindings = <&kp APOS>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // È
ZMK_MACRO_ONE_PARAM(E_CI, bindings = <&fr_e_cf>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ê
ZMK_MACRO_ONE_PARAM(I_CI, bindings = <&fr_i_cf>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Î
ZMK_MACRO_ONE_PARAM(O_CI, bindings = <&fr_o_cf>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ô
ZMK_MACRO_ONE_PARAM(U_CI, bindings = <&fr_u_cf>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Û
ZMK_MACRO_ONE_PARAM(U_GR, bindings = <&fr_u_gr>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ù
ZMK_MACRO_ONE_PARAM(AE_L, bindings = <&fr_ae>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Æ
ZMK_MACRO_ONE_PARAM(OE_L, bindings = <&fr_oe>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Œ
ZMK_MACRO_ONE_PARAM(CEDIL, bindings = <&kp RBKT>, <&macro_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 =
<&macro_press &kp RALT>,
<&macro_tap &kp LBKT &kp LBKT>,
<&macro_release &kp RALT>;
)

// ^ directly
ZMK_BEHAVIOR(CAR, macro, bindings =
ZMK_MACRO(CAR, bindings =
<&macro_tap &kp LBKT &kp SPACE>;
)

// ¨ directly
ZMK_BEHAVIOR(TREMA, macro_one_param, bindings =
ZMK_MACRO_ONE_PARAM(TREMA, bindings =
<&macro_tap &kp LS(LBKT) &kp SPACE>,
<&macro_param_1to1>,
<&to MACRO_PLACEHOLDER>;
)

// ` to input
ZMK_BEHAVIOR(AGRA, macro_two_param, bindings =
ZMK_MACRO_TWO_PARAM(AGRA, bindings =
<&kp RA(LBKT)>,
<&macro_param_1to1>,
<&macro_tap &kp MACRO_PLACEHOLDER>,
Expand All @@ -85,15 +84,15 @@ 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)>,
<&macro_param_1to1>,
<&macro_tap &kp MACRO_PLACEHOLDER>,
<&to QWE>;
)

// ´ to input
ZMK_BEHAVIOR(AIGU, macro_two_param, bindings =
ZMK_MACRO_TWO_PARAM(AIGU, bindings =
<&kp RA(SLASH)>,
<&macro_param_1to1>,
<&macro_tap &kp MACRO_PLACEHOLDER>,
Expand All @@ -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)>,
<&macro_param_1to1>,
<&macro_tap &kp MACRO_PLACEHOLDER>,
Expand All @@ -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>,
<&macro_param_1to1>,
<&macro_tap &kp MACRO_PLACEHOLDER>,
Expand All @@ -120,15 +119,15 @@ 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>,
<&macro_param_1to1>,
<&macro_tap &kp MACRO_PLACEHOLDER>,
<&to QWE>;
)

// Keypress then return to default layer
ZMK_BEHAVIOR(KPD, macro_two_param, bindings =
ZMK_MACRO_TWO_PARAM(KPD, bindings =
<&macro_param_1to1>,
<&kp MACRO_PLACEHOLDER>,
<&macro_param_2to1>,
Expand Down

0 comments on commit 25b8a30

Please sign in to comment.