Skip to content

Commit

Permalink
fix: cleanup homerow mods macros + comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffDess committed Aug 6, 2024
1 parent fba787f commit 68dcc76
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 62 deletions.
50 changes: 11 additions & 39 deletions behaviors/hold-tap.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,7 @@ ZMK_HOLD_TAP(hmr,
hold-trigger-on-release;
)

// homerow mods for circumflex
ZMK_HOLD_TAP(hrmc,
flavor = "balanced";
tapping-term-ms = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
global-quick-tap;
bindings = <&kp>, <&CIRC_D>;
)

// homerow mods for grave
ZMK_HOLD_TAP(hrmg,
flavor = "balanced";
tapping-term-ms = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
global-quick-tap;
bindings = <&kp>, <&AGRA_D>;
)

// homerow mods for è
ZMK_HOLD_TAP(hrme,
flavor = "balanced";
tapping-term-ms = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
global-quick-tap;
bindings = <&kp>, <&E_GR_D>;
)

// homerow mods for è
// homerow mods for è (Colemak)
ZMK_HOLD_TAP(hrmeg,
flavor = "balanced";
tapping-term-ms = <hrm_tap_term>;
Expand All @@ -67,13 +40,13 @@ ZMK_HOLD_TAP(hrmeg,
bindings = <&kp>, <&E_GR_C>;
)

// homerow mods for ê
ZMK_HOLD_TAP(hrmec,
// homerow mods for î (Colemak)
ZMK_HOLD_TAP(hrmic,
flavor = "balanced";
tapping-term-ms = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
global-quick-tap;
bindings = <&kp>, <&E_CI_E>;
bindings = <&kp>, <&I_CI_C>;
)

// homerow mods for î (QWERTY)
Expand All @@ -82,24 +55,23 @@ ZMK_HOLD_TAP(hrmiq,
tapping-term-ms = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
global-quick-tap;
bindings = <&kp>, <&I_CI_D>;
bindings = <&kp>, <&I_CI_Q>;
)

// homerow mods for î (Colemak)
ZMK_HOLD_TAP(hrmic,
// homerow mods for è (QWERTY)
ZMK_HOLD_TAP(hrme,
flavor = "balanced";
tapping-term-ms = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
global-quick-tap;
bindings = <&kp>, <&I_CI_C>;
bindings = <&kp>, <&E_GR_Q>;
)


// homerow mods for scroll (Mouse)
ZMK_HOLD_TAP(hrmw,
// homerow mods for ê (Ergo-L)
ZMK_HOLD_TAP(hrmec,
flavor = "balanced";
tapping-term-ms = <hrm_tap_term>;
quick-tap-ms = <hrm_quick_tap>;
global-quick-tap;
bindings = <&kp>, <&msc>;
bindings = <&kp>, <&E_CI_E>;
)
37 changes: 14 additions & 23 deletions layouts/canadian-multilingual-standard.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@
#define LAQUO RA(Z) // «
#define RAQUO RA(X) // »


// MOD-MORPH - lowercase / uppercase accented characters
// NOTE: Only accents accessed with a dead key on CSA need to have this mod-morph
// Otherwise the shift key will be pressed before the macro and will not be registering
// It's not required for accents with direct acces such as: à é è ç
ZMK_MOD_MORPH(morph_a_circ, bindings = <&CIRC A>, <&CIRC LS(A)>; mods = <(MOD_LSFT|MOD_RSFT)>;) // â / Â
ZMK_MOD_MORPH(morph_e_circ, bindings = <&CIRC E>, <&CIRC LS(E)>; mods = <(MOD_LSFT|MOD_RSFT)>;) // ê / Ê
ZMK_MOD_MORPH(morph_e_trem, bindings = <&TREM E>, <&TREM LS(E)>; mods = <(MOD_LSFT|MOD_RSFT)>;) // ê / Ê
Expand All @@ -52,13 +56,14 @@ ZMK_MOD_MORPH(morph_u_trem, bindings = <&TREM U>, <&TREM LS(U)>; mods = <(MOD_LS
ZMK_MOD_MORPH(morph__ae, bindings = <&kp RC(A)>, <&kp LS(RC(A))>; mods = <(MOD_LSFT|MOD_RSFT)>;) // æ / Æ
ZMK_MOD_MORPH(morph__oe, bindings = <&kp RC(E)>, <&kp LS(RC(E))>; mods = <(MOD_LSFT|MOD_RSFT)>;) // œ / Œ


// KEYMAP MACROS
// The following macros return to the specified layer after being pressed
ZMK_MACRO_ONE_PARAM(A_GR, bindings = <&kp BACKSLASH>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // À
ZMK_MACRO_ONE_PARAM(A_CI, bindings = <&morph_a_circ>, <&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(E_CI, bindings = <&morph_e_circ>, <&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 = <&morph_e_circ>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ê
ZMK_MACRO_ONE_PARAM(E_TR, bindings = <&morph_e_trem>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ê
ZMK_MACRO_ONE_PARAM(I_CI, bindings = <&morph_i_circ>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Î
ZMK_MACRO_ONE_PARAM(I_TR, bindings = <&morph_i_trem>, <&macro_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ê
Expand All @@ -73,16 +78,18 @@ ZMK_MACRO_ONE_PARAM(CEDIL, bindings = <&kp RBKT>, <&macro_param_1to1>, <&to MACR


// ACCENTS HOME ROW MODS
// NOTE: Accents on the home row are needed as it seems impossible to pass
// parameters to a hold-tap

// QWERTY
ZMK_MACRO(E_GR_D, bindings = <&kp APOS>, <&to QWE>;) // È
ZMK_MACRO(I_CI_D, bindings = <&morph_i_circ>, <&to QWE>;) // Î
/* QWERTY */
ZMK_MACRO(E_GR_Q, bindings = <&kp APOS>, <&to QWE>;) // È
ZMK_MACRO(I_CI_Q, bindings = <&morph_i_circ>, <&to QWE>;) // Î

// Colemak
/* Colemak */
ZMK_MACRO(E_GR_C, bindings = <&kp APOS>, <&to COL>;) // È
ZMK_MACRO(I_CI_C, bindings = <&morph_i_circ>, <&to COL>;) // Î

// Ergo-L
/* Ergo-L */
ZMK_MACRO(E_CI_E, bindings = <&morph_e_circ>, <&to ERG>;) // Ê

// ACCENTS MACROS
Expand Down Expand Up @@ -113,14 +120,6 @@ ZMK_MACRO_ONE_PARAM(AGRA, bindings =
<&macro_tap &kp MACRO_PLACEHOLDER>;
)

// ` to input then to default layer
ZMK_MACRO_ONE_PARAM(AGRA_D, bindings =
<&kp ACC_GR>,
<&macro_param_1to1>,
<&macro_tap &kp MACRO_PLACEHOLDER>,
<&to QWE>;
)

// ´ to input
ZMK_MACRO_TWO_PARAM(AIGU, bindings =
<&kp ACC_AI>,
Expand All @@ -144,14 +143,6 @@ ZMK_MACRO_ONE_PARAM(CIRC, bindings =
<&macro_tap &kp MACRO_PLACEHOLDER>;
)

// ^ to input then to default layer
ZMK_MACRO_ONE_PARAM(CIRC_D, bindings =
<&kp ACC_CI>,
<&macro_param_1to1>,
<&macro_tap &kp MACRO_PLACEHOLDER>,
<&to QWE>;
)

// Keypress then return to default layer
ZMK_MACRO_TWO_PARAM(KPD, bindings =
<&macro_param_1to1>,
Expand Down

0 comments on commit 68dcc76

Please sign in to comment.