-
Notifications
You must be signed in to change notification settings - Fork 6
/
canadian-multilingual-standard.dtsi
150 lines (124 loc) · 5.86 KB
/
canadian-multilingual-standard.dtsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#undef CONFIG_ZMK_MACRO_DEFAULT_WAIT_MS
#define CONFIG_ZMK_MACRO_DEFAULT_WAIT_MS 30
#undef CONFIG_ZMK_MACRO_DEFAULT_TAP_MS
#define CONFIG_ZMK_MACRO_DEFAULT_TAP_MS 40
/* Canadian Multilingual Standard Mappings */
#define SLSH GRAVE // /
#define ASLSH RA(SLASH) // / on iOS
#define SAPOS LS(COMMA) // '
#define DAPOS LS(DOT) // "
#define DEG RA(SEMI) // °
#define LBRAC RA(N7) // {
#define RBRAC RA(N8) // }
#define LBKET RA(N9) // [
#define RBKET RA(N0) // ]
#define QUEST LS(N6) // ?
#define PIP RA(GRAVE) // |
#define TILDS RA(RBKT) // ~
#define LETHAN RA(COMMA) // ≤
#define GRTHAN RA(DOT) // ≥
#define ACC_AI RA(SLASH) // ´
#define ACC_CI LBKT // ^
#define ACC_GR RA(LBKT) // `
#define ACC_TR LS(LBKT) // ¨
/* Fractions */
#define MATH_1_4 RC(N4) // ¼
#define MATH_1_2 RC(N5) // ½
#define MATH_3_4 RC(N6) // ¾
/* Symbols */
#define MATH_PM RA(N1) //
#define MATH_DEG RA(SEMI) // °
#define MATH_MICRO RA(M) // µ
/* Typography */
#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 access 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)>;) // ê / Ê
ZMK_MOD_MORPH(morph_i_circ, bindings = <&CIRC I>, <&CIRC LS(I)>; mods = <(MOD_LSFT|MOD_RSFT)>;) // î / Î
ZMK_MOD_MORPH(morph_i_trem, bindings = <&TREM I>, <&TREM LS(I)>; mods = <(MOD_LSFT|MOD_RSFT)>;) // ê / Ê
ZMK_MOD_MORPH(morph_o_circ, bindings = <&CIRC O>, <&CIRC LS(O)>; mods = <(MOD_LSFT|MOD_RSFT)>;) // ô / Ô
ZMK_MOD_MORPH(morph_o_trem, bindings = <&TREM O>, <&TREM LS(O)>; mods = <(MOD_LSFT|MOD_RSFT)>;) // ê / Ê
ZMK_MOD_MORPH(morph_u_circ, bindings = <&CIRC U>, <&CIRC LS(U)>; mods = <(MOD_LSFT|MOD_RSFT)>;) // û / Û
ZMK_MOD_MORPH(morph_u_grav, bindings = <&AGRA U>, <&AGRA LS(U)>; mods = <(MOD_LSFT|MOD_RSFT)>;) // ù / Ù
ZMK_MOD_MORPH(morph_u_trem, bindings = <&TREM U>, <&TREM LS(U)>; mods = <(MOD_LSFT|MOD_RSFT)>;) // ê / Ê
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_CI, bindings = <&morph_a_circ>, <¯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(E_CI, bindings = <&morph_e_circ>, <¯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_TR, bindings = <&morph_e_trem>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ê
ZMK_MACRO_ONE_PARAM(I_CI, bindings = <&morph_i_circ>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Î
ZMK_MACRO_ONE_PARAM(I_TR, bindings = <&morph_i_trem>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ê
ZMK_MACRO_ONE_PARAM(O_CI, bindings = <&morph_o_circ>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ô
ZMK_MACRO_ONE_PARAM(O_TR, bindings = <&morph_o_trem>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ê
ZMK_MACRO_ONE_PARAM(U_CI, bindings = <&morph_u_circ>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Û
ZMK_MACRO_ONE_PARAM(U_GR, bindings = <&morph_u_grav>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ù
ZMK_MACRO_ONE_PARAM(U_TR, bindings = <&morph_u_trem>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ê
ZMK_MACRO_ONE_PARAM(AE_L, bindings = <&morph__ae>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Æ
ZMK_MACRO_ONE_PARAM(OE_L, bindings = <&morph__oe>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Œ
ZMK_MACRO_ONE_PARAM(CEDIL, bindings = <&kp RBKT>, <¯o_param_1to1>, <&to MACRO_PLACEHOLDER>;) // Ç
// 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_Q, bindings = <&kp APOS>, <&to QWE>;) // È
ZMK_MACRO(I_CI_Q, bindings = <&morph_i_circ>, <&to QWE>;) // Î
/* Colemak */
ZMK_MACRO(E_GR_C, bindings = <&kp APOS>, <&to COL>;) // È
ZMK_MACRO(I_CI_C, bindings = <&morph_i_circ>, <&to COL>;) // Î
/* Ergo-L */
ZMK_MACRO(E_CI_E, bindings = <&morph_e_circ>, <&to ERG>;) // Ê
// ACCENTS MACROS
/* Accents without letter */
// ` directly
ZMK_MACRO(GRA, bindings =
<¯o_press &kp RALT>,
<¯o_tap &kp LBKT &kp LBKT>,
<¯o_release &kp RALT>;
)
// ^ directly
ZMK_MACRO(CAR, bindings =
<¯o_tap &kp LBKT &kp SPACE>;
)
// ¨ directly
ZMK_MACRO_ONE_PARAM(TREMA, bindings =
<¯o_tap &kp ACC_TR &kp SPACE>,
<¯o_param_1to1>,
<&to MACRO_PLACEHOLDER>;
)
/* Accents applied to letter */
// ` to input
ZMK_MACRO_ONE_PARAM(AGRA, bindings =
<&kp ACC_GR>,
<¯o_param_1to1>,
<¯o_tap &kp MACRO_PLACEHOLDER>;
)
// ´ to input
ZMK_MACRO_TWO_PARAM(AIGU, bindings =
<&kp ACC_AI>,
<¯o_param_1to1>,
<¯o_tap &kp MACRO_PLACEHOLDER>,
<¯o_param_2to1>,
<&to MACRO_PLACEHOLDER>;
)
// ¨ to input
ZMK_MACRO_ONE_PARAM(TREM, bindings =
<&kp ACC_TR>,
<¯o_param_1to1>,
<¯o_tap &kp MACRO_PLACEHOLDER>;
)
// ^ to input
ZMK_MACRO_ONE_PARAM(CIRC, bindings =
<&kp ACC_CI>,
<¯o_param_1to1>,
<¯o_tap &kp MACRO_PLACEHOLDER>;
)