Skip to content

Commit

Permalink
fix magic/repeat for shifted alphas
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelromao committed Apr 26, 2024
1 parent f7e9206 commit 5ad7df1
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 29 deletions.
Binary file modified img/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion src/zmk/definitions/keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define ATIL_TERM 0x070109
#define OTIL_TERM 0x07010A
#define AGRV_TERM 0x07010B

#define C_QU_TERM 0x07010C
#define C_AACU_TERM 0x07010D
#define C_EACU_TERM 0x07010E
Expand All @@ -30,5 +31,19 @@
#define C_ATIL_TERM 0x070115
#define C_OTIL_TERM 0x070116
#define C_AGRV_TERM 0x070117

#define SQUO_TERM 0x070118
#define C_SQUO_TERM 0x070119
#define C_SQUO_TERM 0x070119

#define S_QU_TERM 0x07011A
#define S_AACU_TERM 0x07011B
#define S_EACU_TERM 0x07011C
#define S_IACU_TERM 0x07011D
#define S_OACU_TERM 0x07011E
#define S_UACU_TERM 0x07011F
#define S_ACIR_TERM 0x070120
#define S_ECIR_TERM 0x070121
#define S_OCIR_TERM 0x070122
#define S_ATIL_TERM 0x070123
#define S_OTIL_TERM 0x070124
#define S_AGRV_TERM 0x070125
14 changes: 7 additions & 7 deletions src/zmk/definitions/keymap.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
shifted_alpha1_layer {
label = "CASE";
bindings = <
&trans &kp LS(B) &kp LS(M) &kp LS(G) &kp LS(K) &kp LS(X) &kp LS(L) &kp LS(O) &kp LS(U) &trans
&lt SHORTS_L LS(D) &mt LSHFT LS(N) &mt LCTRL LS(S) &mt LGUI LS(T) &kp LS(W) &kp LS(Z) &mt RGUI LS(R) &mt RCTRL LS(A) &mt RSHFT LS(E) &lt SHORTS_R LS(I)
&lt SHORTS_L LS(D) &mt RALT LS(F) &kp LS(C) &mt LALT LS(P) &kp LS(V) &kp LS(J) &mt RALT LS(H) &th_comma 0 0 &th_dot 0 0 &lt SHORTS_R LS(I)
&trans &kp RS(B) &kp RS(M) &kp RS(G) &kp RS(K) &kp RS(X) &kp RS(L) &kp RS(O) &kp RS(U) &trans
&lt SHORTS_L RS(D) &mt LSHFT RS(N) &mt LCTRL RS(S) &mt LGUI RS(T) &kp RS(W) &kp RS(Z) &mt RGUI RS(R) &mt RCTRL RS(A) &mt RSHFT RS(E) &lt SHORTS_R RS(I)
&lt SHORTS_L RS(D) &mt RALT RS(F) &kp RS(C) &mt LALT RS(P) &kp RS(V) &kp RS(J) &mt RALT RS(H) &th_comma 0 0 &th_dot 0 0 &lt SHORTS_R RS(I)
&trans &ht_repeat NAV 0 &msk_spc LOWER 0 &msl RAISE SHIFT_A2 &ht_caps MEDIA 0 &trans
>;
};
Expand Down Expand Up @@ -182,9 +182,9 @@
shifted_alpha2_layer {
label = "CASE";
bindings = <
&none &kp LS(Q) &mc_qu_cs &kp LS(K) &none &none &ac_ocir_c &ac_oacu_c &ac_uacu_c &none
&kp LS(Y) &kp LS(Z) &kp LS(X) &kp LS(W) &none &none &ac_atil_c &ac_aacu_c &ac_eacu_c &ac_iacu_c
&kp LS(Y) &kp LS(J) &mc_ced_c &kp LS(V) &none &none &ac_otil_c &ac_acir_c &ac_ecir_c &ac_iacu_c
&none &kp RS(Q) &mc_qu_s &kp RS(K) &none &none &ac_ocir_s &ac_oacu_s &ac_uacu_s &none
&kp RS(Y) &kp RS(Z) &kp RS(X) &kp RS(W) &none &none &ac_atil_s &ac_aacu_s &ac_eacu_s &ac_iacu_s
&kp RS(Y) &kp RS(J) &mc_ced_s &kp RS(V) &none &none &ac_otil_s &ac_acir_s &ac_ecir_s &ac_iacu_s
&trans &ht_magic NAV 0 &sl SYMBOLS &trans &mc_sqo_c &trans
>;
};
Expand Down Expand Up @@ -227,7 +227,7 @@
sentence_case_ext2_layer {
label = "CASE";
bindings = <
&none &kp LS(Q) &mc_qu_cs &kp LS(K) &none &none &ac_ocir_c &ac_oacu_c &ac_uacu_c &none
&none &kp LS(Q) &mc_qu_s &kp LS(K) &none &none &ac_ocir_c &ac_oacu_c &ac_uacu_c &none
&kp LS(Y) &kp LS(Z) &kp LS(X) &kp LS(W) &none &none &ac_atil_c &ac_aacu_c &ac_eacu_c &ac_iacu_c
&kp LS(Y) &kp LS(J) &mc_ced_c &kp LS(V) &none &none &ac_otil_c &ac_acir_c &ac_ecir_c &ac_iacu_c
&trans &th_cancel NAV 0 &th_sp_ns SYMBOLS 0 &none &th_nsen MEDIA 0 &trans
Expand Down
50 changes: 30 additions & 20 deletions src/zmk/features/accents.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

/ {
#define ACCENTED_KEY(NAME, KEY, DEAD_KEY, TERM, C_TERM) \
NAME##_l: NAME##_l { \
#define ACCENTED_KEY(NAME, KEY, DEAD_KEY, TERM, C_TERM, S_TERM) \
NAME: NAME { \
wait-ms = <0>; \
tap-ms = <0>; \
compatible = "zmk,behavior-macro"; \
Expand Down Expand Up @@ -36,13 +36,22 @@
, <&macro_tap &kp C_TERM> \
; \
}; \
NAME: NAME { \
compatible = "zmk,behavior-mod-morph"; \
NAME##_s: NAME##_s { \
wait-ms = <0>; \
tap-ms = <0>; \
compatible = "zmk,behavior-macro"; \
#binding-cells = <0>; \
bindings = <&NAME##_l>, <&NAME##_c>; \
mods = <(MOD_LSFT|MOD_RSFT)>; \
keep-mods = <(MOD_LSFT|MOD_RSFT)>; \
};
bindings \
= <&macro_release &kp LSHFT> \
, <&macro_press &kp LALT> \
, <&macro_tap &kp DEAD_KEY> \
, <&macro_release &kp LALT> \
, <&macro_press &kp LSHFT> \
, <&macro_tap &kp KEY> \
, <&macro_release &kp LSHFT> \
, <&macro_tap &kp S_TERM> \
; \
}; \

#define MACRO_KEY(NAME, BINDINGS) \
NAME: NAME { \
Expand All @@ -55,22 +64,23 @@


accents {
ACCENTED_KEY(ac_agrv, A, GRAVE, AGRV_TERM, C_AGRV_TERM)
ACCENTED_KEY(ac_aacu, A, E , AACU_TERM, C_AACU_TERM)
ACCENTED_KEY(ac_atil, A, N , ATIL_TERM, C_ATIL_TERM)
ACCENTED_KEY(ac_acir, A, I , ACIR_TERM, C_ACIR_TERM)
ACCENTED_KEY(ac_eacu, E, E , EACU_TERM, C_EACU_TERM)
ACCENTED_KEY(ac_ecir, E, I , ECIR_TERM, C_ECIR_TERM)
ACCENTED_KEY(ac_iacu, I, E , IACU_TERM, C_IACU_TERM)
ACCENTED_KEY(ac_oacu, O, E , OACU_TERM, C_OACU_TERM)
ACCENTED_KEY(ac_otil, O, N , OTIL_TERM, C_OTIL_TERM)
ACCENTED_KEY(ac_ocir, O, I , OCIR_TERM, C_OCIR_TERM)
ACCENTED_KEY(ac_uacu, U, E , UACU_TERM, C_UACU_TERM)
ACCENTED_KEY(ac_agrv, A, GRAVE, AGRV_TERM, C_AGRV_TERM, S_AGRV_TERM)
ACCENTED_KEY(ac_aacu, A, E , AACU_TERM, C_AACU_TERM, S_AACU_TERM)
ACCENTED_KEY(ac_atil, A, N , ATIL_TERM, C_ATIL_TERM, S_ATIL_TERM)
ACCENTED_KEY(ac_acir, A, I , ACIR_TERM, C_ACIR_TERM, S_ACIR_TERM)
ACCENTED_KEY(ac_eacu, E, E , EACU_TERM, C_EACU_TERM, S_EACU_TERM)
ACCENTED_KEY(ac_ecir, E, I , ECIR_TERM, C_ECIR_TERM, S_ECIR_TERM)
ACCENTED_KEY(ac_iacu, I, E , IACU_TERM, C_IACU_TERM, S_IACU_TERM)
ACCENTED_KEY(ac_oacu, O, E , OACU_TERM, C_OACU_TERM, S_OACU_TERM)
ACCENTED_KEY(ac_otil, O, N , OTIL_TERM, C_OTIL_TERM, S_OTIL_TERM)
ACCENTED_KEY(ac_ocir, O, I , OCIR_TERM, C_OCIR_TERM, S_OCIR_TERM)
ACCENTED_KEY(ac_uacu, U, E , UACU_TERM, C_UACU_TERM, S_UACU_TERM)

MACRO_KEY(mc_ced, &kp C_CEDIL)
MACRO_KEY(mc_ced_c, &kp LS(C_CEDIL))
MACRO_KEY(mc_ced_s, &kp RS(C_CEDIL))
MACRO_KEY(mc_qu, &macro_tap &kp Q &macro_wait_time 10 &macro_tap &kp U &kp QU_TERM)
MACRO_KEY(mc_qu_c, &macro_press &kp LSHFT &macro_tap &kp Q &macro_wait_time 10 &macro_tap &kp U &macro_release &kp LSHFT &kp QU_TERM)
MACRO_KEY(mc_qu_cs, &macro_press &kp LSHFT &macro_tap &kp Q &macro_wait_time 10 &macro_release &kp LSHFT &macro_tap &kp U &kp QU_TERM)
MACRO_KEY(mc_qu_s, &macro_press &kp LSHFT &macro_tap &kp Q &macro_wait_time 10 &macro_release &kp LSHFT &macro_tap &kp U &kp QU_TERM)
};
};
26 changes: 25 additions & 1 deletion src/zmk/features/thumbs.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,31 @@
LS(K) C_OACU_TERM C_OTIL_TERM C_OCIR_TERM \
C_QU_TERM C_SQUO_TERM LS(U) C_UACU_TERM LS(V) LS(W) \
LS(X) LS(Y) \

RS(A) S_AACU_TERM S_ATIL_TERM S_ACIR_TERM S_AGRV_TERM RS(C_CEDIL) \
S_EACU_TERM S_ECIR_TERM RS(H) RS(I) S_IACU_TERM RS(J) \
RS(K) S_OACU_TERM S_OTIL_TERM S_OCIR_TERM \
S_QU_TERM RS(U) S_UACU_TERM RS(V) RS(W) \
RS(X) RS(Y) \
>;
bindings = <
&kp V &kp V &kp O &kp N &mc_qu &tc_atilo \
&kp V &kp E &tc_oes &tc_ng &kp V &ac_aacu \
&tc_ey &kp V &tc_es &kp O \
&ac_ecir &kp V &kp Y &kp V &ac_aacu &tc_hy \
&ac_aacu &tc_ou &tc_com \
&ac_aacu &tc_ou &tc_com \

&kp LS(V) &kp LS(V) &kp LS(O) &kp LS(N) &mc_qu_c &tc_atilo_c \
&kp LS(V) &kp LS(E) &tc_oes_c &tc_ng_c &kp LS(V) &ac_aacu_c \
&tc_ey_c &kp LS(V) &tc_es_c &kp LS(O) \
&ac_ecir_c &kp LS(V) &kp LS(Y) &kp LS(V) &ac_aacu_c &tc_hy_c \
&ac_aacu_c &tc_ou_c \

&kp V &kp V &kp O &kp N &mc_qu &tc_atilo \
&kp V &kp E &tc_oes &tc_ng &kp V &ac_aacu \
&tc_ey &kp V &tc_es &kp O \
&ac_ecir &kp Y &kp V &ac_aacu &tc_hy \
&ac_aacu &tc_ou \
>;
};

Expand Down Expand Up @@ -234,6 +246,12 @@
LS(K) LS(L) LS(M) LS(N) C_OACU_TERM C_OTIL_TERM C_OCIR_TERM LS(P) \
C_QU_TERM LS(R) LS(S) LS(T) LS(U) C_UACU_TERM LS(V) LS(W) \
LS(X) \

RS(A) S_AACU_TERM S_ATIL_TERM S_ACIR_TERM S_AGRV_TERM RS(B) RS(C) RS(C_CEDIL) RS(D) \
RS(E) S_EACU_TERM S_ECIR_TERM RS(F) RS(H) RS(I) S_IACU_TERM RS(J) \
RS(K) RS(L) RS(M) RS(N) S_OACU_TERM S_OTIL_TERM S_OCIR_TERM RS(P) \
S_QU_TERM RS(R) RS(S) RS(T) RS(U) S_UACU_TERM RS(V) RS(W) \
RS(X) \
>;
bindings = <
&kp O &kp X &kp O &kp M &mc_qu &kp Y &kp S &tc_otiles &kp Y \
Expand All @@ -247,6 +265,12 @@
&kp LS(W) &kp LS(H) &kp LS(S) &kp LS(F) &kp LS(X) &kp LS(E) &kp LS(V) &kp LS(T) \
&ac_iacu_c &tc_ly_c &kp LS(C) &kp LS(W) &kp LS(E) &kp LS(Z) &ac_iacu_c &kp LS(K) \
&ac_iacu_c \

&kp O &kp X &kp O &kp M &mc_qu &kp Y &kp S &tc_otiles &kp Y \
&kp U &kp U &kp X &kp Y &kp R &tc_smart_i &kp Z &ac_atil \
&kp W &kp H &kp S &kp F &kp X &kp E &kp V &kp T \
&ac_iacu &tc_ly &kp S &kp W &kp E &kp Z &ac_iacu &kp K \
&ac_iacu \
>;
};

Expand Down

0 comments on commit 5ad7df1

Please sign in to comment.