From 7f24c642ccca570bcf3a9d281de26890f8980e2e Mon Sep 17 00:00:00 2001 From: urob <978080+urob@users.noreply.github.com> Date: Fri, 5 Aug 2022 10:29:07 -0400 Subject: [PATCH] Update hold-tap config for positional-hold-tap fix --- config/base.keymap | 51 ++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/config/base.keymap b/config/base.keymap index 0b6dd3e..6c55573 100644 --- a/config/base.keymap +++ b/config/base.keymap @@ -1,15 +1,9 @@ /* ISSUES, WORKAROUNDS and a "ZMK-WISHLIST" * tap-only combos not yet possible (#544), prevents rapid chording of HRMs - * no chording with positional hold-taps (#1363) * &bootloader doesn't work with Planck_rev6 (#1086) - * no global-quick-tap for combos yet - * mod-taps getting stuck with heterogenous combo-terms (#986, #905) * sticky-hold swallows OS shift when typing quickly, using sticky-tap for now * native sleep key doesn't work with windows (#1077), using sleep-macro for now - * no native unicode support (#232), using preprocessor workaround instead - * no native mouse keys (#319), using mouse PR #778 - * mod-morph doesn't swallow mod (#686), using masked-mod PR #1114 * invalid DFU suffix signature warning when flashing with dfu-util */ @@ -44,7 +38,7 @@ ISSUES, WORKAROUNDS and a "ZMK-WISHLIST" #define FN 4 #define UC 5 -#define QUICK_TAP_MS 220 +#define QUICK_TAP_MS 175 #include "combos.dtsi" // source after layer shortcuts #include "mouse.dtsi" @@ -71,28 +65,26 @@ ISSUES, WORKAROUNDS and a "ZMK-WISHLIST" /* homerow mods */ -#define HRM_LT LM1 LM2 LM3 LM4 // left-hand HRMs -#define HRM_RT RM1 RM2 RM3 RM4 // right-hand HRMs -#define KEYS_LT LT0 LT1 LT2 LT3 LT4 LM0 HRM_LT LB0 LB1 LB2 LB3 LB4 // left-hand keys -#define KEYS_RT RT0 RT1 RT2 RT3 RT4 RM0 HRM_RT RB0 RB1 RB2 RB3 RB4 // right-hand keys -#define THUMBS LH2 LH1 LH0 RH0 RH1 RH2 // thumb keys +#define KEYS_L LT0 LT1 LT2 LT3 LT4 LM0 LM1 LM2 LM3 LM4 LB0 LB1 LB2 LB3 LB4 // left-hand keys +#define KEYS_R RT0 RT1 RT2 RT3 RT4 RM0 RM1 RM2 RM3 RM4 RB0 RB1 RB2 RB3 RB4 // right-hand keys +#define THUMBS LH2 LH1 LH0 RH0 RH1 RH2 // thumb keys ZMK_BEHAVIOR(hml, hold_tap, // left-hand HRMs flavor = "balanced"; - tapping-term-ms = <200>; + tapping-term-ms = <280>; quick-tap-ms = ; global-quick-tap-ms = <150>; bindings = <&kp>, <&kp>; - hold-trigger-key-positions = ; // include left-hand HRMs for chording + hold-trigger-key-positions = ; ) ZMK_BEHAVIOR(hmr, hold_tap, // right-hand HRMs flavor = "balanced"; - tapping-term-ms = <200>; + tapping-term-ms = <280>; quick-tap-ms = ; global-quick-tap-ms = <150>; bindings = <&kp>, <&kp>; - hold-trigger-key-positions = ; // include right-hand HRMs for chording + hold-trigger-key-positions = ; ) /* custom keys and macros */ @@ -107,7 +99,7 @@ ZMK_BEHAVIOR(ss_cw, tap_dance, ZMK_BEHAVIOR(bs_del_num, mod_morph, bindings = << NUM BSPC>, <&kp DEL>; mods = <(MOD_LSFT|MOD_RSFT)>; - masked_mods = ; // requires PR #1114 + masked-mods = ; // requires PR #1412 ) // Windows sleep key @@ -117,6 +109,29 @@ ZMK_BEHAVIOR(win_sleep, macro, bindings = <&kp LG(X) &kp U &kp S>; ) +// Sticky layer + sticky shift +ZMK_BEHAVIOR(uc_shift, macro, + wait-ms = <0>; + tap-ms = <1>; + bindings = <¯o_press &mo UC &kp LSHFT> + , <¯o_pause_for_release> + , <¯o_release &mo UC &kp LSHFT>; +) + +/ { + behaviors { + sls: sticky_uc_shift { + compatible = "zmk,behavior-sticky-key"; + label = "STICKY_UC_SHIFT"; + #binding-cells = <1>; + release-after-ms = <1000>; + bindings = <&uc_shift>; + ignore-modifiers; + }; + }; +}; + + /* keymap */ ZMK_LAYER(default_layer, @@ -127,7 +142,7 @@ ZMK_LAYER(default_layer, // ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ &kp Z &kp X &kp C &kp D &kp V EXTRA_MID &kp K &kp H &kp COMMA &kp DOT &kp SEMI // ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ - EXTRA_BOT_L < UC ESC < NAV SPACE < SYS TAB EXTRA_MID < FN RET &ss_cw &bs_del_num EXTRA_BOT_R + EXTRA_BOT_L < SYS ESC < NAV SPACE < UC TAB EXTRA_MID < FN RET &ss_cw &bs_del_num EXTRA_BOT_R // ╰─────────────╯ ╰─────────────┴──── ────────┴─────────────╯ ╰─────────────╯ ╰─────────────┴─────────────┴─────────────╯ ╰─────────────╯ )