Skip to content

Commit

Permalink
Merge pull request #2 from englmaxi/define-based
Browse files Browse the repository at this point in the history
Define based
  • Loading branch information
englmaxi authored Nov 25, 2023
2 parents a59d256 + 5100728 commit ca9bd6f
Show file tree
Hide file tree
Showing 6 changed files with 456 additions and 884 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/draw-keymaps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
contents: write
with:
# commit_message: "[Draw] ${{ github.event.head_commit.message }}"
amend_commit: true
# amend_commit: true
install_branch: "main"
keymap_patterns: "config/*.keymap"
config_path: "keymap-drawer/config.yaml"
output_folder: "keymap-drawer"
Expand Down
76 changes: 76 additions & 0 deletions config/combos.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/* KEY POSITIONS
34 keys:

╭────────────────────╮ ╭────────────────────╮
│ 0 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 ╭───────────╯
╰────────╯ ╰────────╯
*/

#define COMBO(NAME, BINDINGS, KEYPOS, LAYERS, TIMEOUT, ...) \
combo_##NAME { \
timeout-ms = <TIMEOUT>; \
bindings = <BINDINGS>; \
key-positions = <KEYPOS>; \
layers = <LAYERS>; \
require-prior-idle-ms = <150>; \
__VA_ARGS__ \
};

#define COMBO_TERM_FAST 30
#define COMBO_TERM_SLOW 40

#define HRC_TAB &hml LA(LCTRL) TAB
#define HRC_REPEAT &hml_repeat LS(LCTRL) 0
#define HRC_LPAR &hmr_lpar_lt LS(LCTRL) 0
#define HRC_RPAR &hmr_rpar_gt LA(LCTRL) 0
#define HRC_PAR &hmr_par_lgt LS(LALT) 0

/ {
combos {
compatible = "zmk,combos";

COMBO(esc, &kp ESC, 1 2, DEF FUN NUM, COMBO_TERM_SLOW)
COMBO(enter, &kp RET, 2 3, DEF FUN NUM, COMBO_TERM_SLOW)
COMBO(ger, &sl GER, 1 3, DEF, COMBO_TERM_SLOW)

COMBO(tab, HRC_TAB, 11 12, DEF FUN NUM, COMBO_TERM_SLOW)
COMBO(repeat, HRC_REPEAT, 12 13, DEF FUN NUM, COMBO_TERM_SLOW)

COMBO(lbkt, &lbkt_lbrc, 6 7, DEF, COMBO_TERM_SLOW)
COMBO(rbkt, &rbkt_rbrc, 7 8, DEF, COMBO_TERM_SLOW)
COMBO(bkt, &bkt_brc, 6 8, DEF, COMBO_TERM_SLOW)

COMBO(lpar, HRC_LPAR, 16 17, DEF, COMBO_TERM_SLOW)
COMBO(rpar, HRC_RPAR, 17 18, DEF, COMBO_TERM_SLOW)
COMBO(par, HRC_PAR, 16 18, DEF, COMBO_TERM_SLOW)

COMBO(bspc, &kp BSPC, 26 27, DEF FUN NUM, COMBO_TERM_SLOW)
COMBO(del, &kp DEL, 27 28, DEF FUN NUM, COMBO_TERM_SLOW)

COMBO(prcnt, &kp DE_PRCNT, 4 14, DEF, COMBO_TERM_FAST)
COMBO(dllr, &kp DE_DLLR, 3 13, DEF, COMBO_TERM_FAST)
COMBO(hash, &kp DE_HASH, 2 12, DEF, COMBO_TERM_FAST)
COMBO(at, &kp DE_AT, 1 11, DEF, COMBO_TERM_FAST)

COMBO(tilde, &kp DE_TILDE, 14 24, DEF, COMBO_TERM_FAST)
COMBO(equal, &kp DE_EQUAL, 13 23, DEF, COMBO_TERM_FAST)
COMBO(bslh, &kp DE_BSLH, 12 22, DEF, COMBO_TERM_FAST)
COMBO(euro, &kp DE_EURO, 11 21, DEF, COMBO_TERM_FAST)

COMBO(caret, &kp DE_CARET, 5 15, DEF, COMBO_TERM_FAST)
COMBO(plus, &kp DE_PLUS, 6 16, DEF, COMBO_TERM_FAST)
COMBO(star, &kp DE_STAR, 7 17, DEF, COMBO_TERM_FAST)
COMBO(amps, &kp DE_AMPS, 8 18, DEF, COMBO_TERM_FAST)
COMBO(sect, &kp DE_SECT, 9 19, DEF, COMBO_TERM_FAST)

COMBO(under, &kp DE_UNDER, 15 25, DEF, COMBO_TERM_FAST)
COMBO(minus, &kp DE_MINUS, 16 26, DEF, COMBO_TERM_FAST)
COMBO(fslh, &kp DE_FSLH, 17 27, DEF, COMBO_TERM_FAST)
COMBO(pipe, &kp DE_PIPE, 18 28, DEF, COMBO_TERM_FAST)
COMBO(deg, &kp DE_DEG, 19 29, DEF, COMBO_TERM_FAST)

};
};
Loading

0 comments on commit ca9bd6f

Please sign in to comment.