Skip to content

Commit

Permalink
HM define
Browse files Browse the repository at this point in the history
  • Loading branch information
englmaxi committed Nov 24, 2023
1 parent c376f80 commit ce6f18a
Showing 1 changed file with 22 additions and 81 deletions.
103 changes: 22 additions & 81 deletions config/cradio.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/outputs.h>

#define TO_STRING(x) #x

#define DEF 0
#define NAV 1
#define NUM 2
Expand Down Expand Up @@ -41,92 +43,31 @@
ignore-modifiers;
};

#define HM(NAME, TAP, HT_KEYPOS) \
NAME: NAME { \
compatible = "zmk,behavior-hold-tap"; \
label = TO_STRING(HM_ ## NAME); \
#binding-cells = <2>; \
tapping-term-ms = <280>; \
quick-tap-ms = <175>; \
require-prior-idle-ms = <175>; \
flavor = "balanced"; \
bindings = <&kp>, <TAP>; \
hold-trigger-key-positions = <HT_KEYPOS THUMBS>; \
hold-trigger-on-release; \
};

/ {

behaviors {
hmr: hmr {
compatible = "zmk,behavior-hold-tap";
label = "HMR";
bindings = <&kp>, <&kp>;

#binding-cells = <2>;
tapping-term-ms = <280>;
quick-tap-ms = <175>;
require-prior-idle-ms = <175>;
flavor = "balanced";
hold-trigger-on-release;
hold-trigger-key-positions = <KEYS_L THUMBS>;
};

hml: hml {
compatible = "zmk,behavior-hold-tap";
label = "HML";
bindings = <&kp>, <&kp>;

#binding-cells = <2>;
tapping-term-ms = <280>;
quick-tap-ms = <175>;
require-prior-idle-ms = <175>;
flavor = "balanced";
hold-trigger-on-release;
hold-trigger-key-positions = <KEYS_R THUMBS>;
};

hml_repeat: hml_repeat {
compatible = "zmk,behavior-hold-tap";
label = "HML_REPEAT";
bindings = <&kp>, <&key_repeat>;

#binding-cells = <2>;
tapping-term-ms = <280>;
quick-tap-ms = <175>;
require-prior-idle-ms = <175>;
flavor = "balanced";
hold-trigger-on-release;
hold-trigger-key-positions = <KEYS_R THUMBS>;
};

hmr_lpar_lt: hmr_lpar_lt {
compatible = "zmk,behavior-hold-tap";
label = "HMR_LPAR_LT";
bindings = <&kp>, <&lpar_lt>;

#binding-cells = <2>;
tapping-term-ms = <280>;
quick-tap-ms = <175>;
require-prior-idle-ms = <150>;
flavor = "balanced";
hold-trigger-on-release;
hold-trigger-key-positions = <KEYS_L THUMBS>;
};

hmr_rpar_gt: hmr_rpar_gt {
compatible = "zmk,behavior-hold-tap";
label = "HMR_RPAR_GT";
bindings = <&kp>, <&rpar_gt>;

#binding-cells = <2>;
tapping-term-ms = <280>;
quick-tap-ms = <175>;
require-prior-idle-ms = <150>;
flavor = "balanced";
hold-trigger-on-release;
hold-trigger-key-positions = <KEYS_L THUMBS>;
};
HM(hml, &kp, KEYS_R)
HM(hml_repeat, &key_repeat, KEYS_R)

hmr_par_lgt: hmr_par_lgt {
compatible = "zmk,behavior-hold-tap";
label = "HMR_PAR_LGT";
bindings = <&kp>, <&par_lgt>;

#binding-cells = <2>;
tapping-term-ms = <280>;
quick-tap-ms = <175>;
require-prior-idle-ms = <150>;
flavor = "balanced";
hold-trigger-on-release;
hold-trigger-key-positions = <KEYS_L THUMBS>;
};
HM(hmr, &kp, KEYS_L)
HM(hmr_lpar_lt, &lpar_lt, KEYS_L)
HM(hmr_rpar_gt, &rpar_gt, KEYS_L)
HM(hmr_par_lgt, &par_lgt, KEYS_L)

td_scw: td_shift_caps_word {
compatible = "zmk,behavior-tap-dance";
Expand Down

0 comments on commit ce6f18a

Please sign in to comment.