update macros and exl layer

This commit is contained in:
Glen Goodwin 2023-08-30 15:00:19 -04:00
parent 6a87847196
commit 69806fe798
2 changed files with 69 additions and 32 deletions

View file

@ -251,11 +251,11 @@ macros {
label = "Exl"; label = "Exl";
bindings = < bindings = <
// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ // ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&bt BT_PRV &bt BT_CLR &bt BT_NXT &none &kp LC(HOME) &kp LC(HOME) &kp F4 &bt BT_SEL 2 &none &none &none &none &exl_nav_beg &exl_sel_row &exl_cmt_ins &exl_sel_col
&none &none &none &none &none &kp LC(END) &bt BT_SEL 3 &kp F2 &bt BT_SEL 5 &kp LS(SPACE) &none &none &none &none &none &exl_nav_end &exl_sel_pre &kp F2 &exl_sel_dep &exl_auto_sum
&none &sys_reset &none &bootloader &exl_cur_fmt &kp LC(TILDE) &none &kp LC(SPACE) &none &none &none &none &exl_cur_fmt &exl_pct_fmt &exl_num_fmt &none
// ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯ // ╰─────────────┴─────────────┴─────────────╮ ╭─────────────┴─────────────┴─────────────╯
&none &none &none &none &none &none &exl_rpt_act &exl_tgl_df
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯ // ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯
>; >;
}; };

View file

@ -1,34 +1,71 @@
/* Macro macro: */
#define str(s) #s
#define MACRO(NAME, BINDINGS) \
macro_##NAME: macro_##NAME { \
compatible = "zmk,behavior-macro"; \
label = str(macro_##NAME); \
#binding-cells = <0>; \
wait-ms = <30>; \
tap-ms = <40>; \
bindings = <BINDINGS>; \
};
/* Brackets */
MACRO(parentheses, &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &kp LEFT)
MACRO(brackets, &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp LEFT)
MACRO(ltgt, &kp LESS_THAN &kp GREATER_THAN &kp LEFT)
/* Suspend macOS by holding power key for 1 second */
MACRO(power, &macro_tap_time 1000 &kp C_POWER)
/* Excel Macros */ /* Excel Macros */
MACRO(exl_auto_sum, &kp LA(EQUAL)) // AutoSum
MACRO(exl_tgl_df, &kp LC(GRAVE)) // Toggle data/formulas
MACRO(exl_pct_fmt, &kp LC(LS(PRCNT))) // Percent format
MACRO(exl_cmt_ins, &kp LC(LS(F2))) // Cell Comment
MACRO(exl_sel_dep, &kp LC(RBKT)) // Select Dependents
MACRO(exl_sel_pre, &kp LC(LBKT)) // Select Precendents
ZMK_MACRO(exl_cur_fmt, // Currency format ZMK_MACRO(exl_cur_fmt, // Currency format
wait-ms = <0>; wait-ms = <0>;
tap-ms = <0>; tap-ms = <0>;
bindings = <&kp LC(LS(DLLR))>;) bindings = <&kp LC(LS(DLLR))>;)
ZMK_MACRO(exl_pct_fmt, // Percent format
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LC(LS(PRCNT))>;)
ZMK_MACRO(exl_num_fmt, // Number format
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LC(LS(EXCL))>;)
ZMK_MACRO(exl_auto_sum, // AutoSum
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LA(EQUAL)>;)
ZMK_MACRO(exl_tgl_df, // Toggle data/formulas
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LC(GRAVE)>;)
ZMK_MACRO(exl_cmt_ins, // Cell Comment
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LC(LS(F2))>;)
ZMK_MACRO(exl_sel_dep, // Select Dependents
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LC(RBKT)>;)
ZMK_MACRO(exl_sel_pre, // Select Precedents
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LC(LBKT)>;)
ZMK_MACRO(exl_sel_row, // Select Row
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LS(SPACE)>;)
ZMK_MACRO(exl_sel_col, // Select Column
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LC(SPACE)>;)
ZMK_MACRO(exl_nav_beg, // Navigate Beginning
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LC(HOME)>;)
ZMK_MACRO(exl_nav_end, // Navigate End
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LC(END)>;)
ZMK_MACRO(exl_del_sel, // Delete Selected row or column
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp LC(MINUS)>;)
ZMK_MACRO(exl_rpt_act, // Repeat Action
wait-ms = <0>;
tap-ms = <0>;
bindings = <&kp F4>;)