-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from englmaxi/define-based
Define based
- Loading branch information
Showing
6 changed files
with
456 additions
and
884 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
}; | ||
}; |
Oops, something went wrong.