Use QUICK_TAP_MS macros

This commit is contained in:
urob 2022-07-28 11:04:00 -04:00
parent 98a55c43f0
commit b683c88bf8
3 changed files with 16 additions and 10 deletions

View file

@ -44,6 +44,8 @@ ISSUES, WORKAROUNDS and a "ZMK-WISHLIST"
#define FN 4 #define FN 4
#define UC 5 #define UC 5
#define QUICK_TAP_MS 220
#include "combos.dtsi" // source after layer shortcuts #include "combos.dtsi" // source after layer shortcuts
#include "mouse.dtsi" #include "mouse.dtsi"
@ -63,7 +65,7 @@ ISSUES, WORKAROUNDS and a "ZMK-WISHLIST"
&lt { &lt {
flavor = "balanced"; flavor = "balanced";
tapping-term-ms = <200>; tapping-term-ms = <200>;
quick-tap-ms = <220>; // double-tap + hold repeats tap-key quick-tap-ms = <QUICK_TAP_MS>; // double-tap + hold repeats tap-key
// global-quick-tap; // global-quick-tap;
}; };
@ -77,8 +79,8 @@ ISSUES, WORKAROUNDS and a "ZMK-WISHLIST"
ZMK_BEHAVIOR(hml, hold_tap, // left-hand HRMs ZMK_BEHAVIOR(hml, hold_tap, // left-hand HRMs
flavor = "balanced"; flavor = "balanced";
tapping-term-ms = <280>; tapping-term-ms = <200>;
quick-tap-ms = <220>; quick-tap-ms = <QUICK_TAP_MS>;
global-quick-tap-ms = <150>; global-quick-tap-ms = <150>;
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
hold-trigger-key-positions = <KEYS_RT THUMBS HRM_LT>; // include left-hand HRMs for chording hold-trigger-key-positions = <KEYS_RT THUMBS HRM_LT>; // include left-hand HRMs for chording
@ -86,8 +88,8 @@ ZMK_BEHAVIOR(hml, hold_tap, // left-hand HRMs
ZMK_BEHAVIOR(hmr, hold_tap, // right-hand HRMs ZMK_BEHAVIOR(hmr, hold_tap, // right-hand HRMs
flavor = "balanced"; flavor = "balanced";
tapping-term-ms = <280>; tapping-term-ms = <200>;
quick-tap-ms = <220>; quick-tap-ms = <QUICK_TAP_MS>;
global-quick-tap-ms = <150>; global-quick-tap-ms = <150>;
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
hold-trigger-key-positions = <KEYS_LT THUMBS HRM_RT>; // include right-hand HRMs for chording hold-trigger-key-positions = <KEYS_LT THUMBS HRM_RT>; // include right-hand HRMs for chording

View file

@ -7,8 +7,9 @@
LH2 LH1 LH0 RH0 RH1 RH2 LH2 LH1 LH0 RH0 RH1 RH2
*/ */
// must be same for all combos to avoid #986, possibly related to #905 // COMBO_TERM must be same for all combos to avoid #986, possibly related to #905
#define COMBO_TERM 30 #define COMBO_TERM 30
#define COMBO_QUICK_TAP_MS 150
/* Punctuation (horizontal left hand) */ /* Punctuation (horizontal left hand) */
ZMK_COMBO(num, &tog NUM, LT3 LT1, DEF NUM) ZMK_COMBO(num, &tog NUM, LT3 LT1, DEF NUM)

View file

@ -1,4 +1,4 @@
/* /*
* helper.h * helper.h
* *
* Convenience macros simplifying ZMK's keymap configuration. * Convenience macros simplifying ZMK's keymap configuration.
@ -48,13 +48,16 @@
#if !defined COMBO_TERM #if !defined COMBO_TERM
#define COMBO_TERM 30 #define COMBO_TERM 30
#endif #endif
#if !defined COMBO_QUICK_TAP_MS
#define COMBO_QUICK_TAP_MS -1
#endif
#define ZMK_COMBO(name, combo_bindings, keypos, combo_layers) \ #define ZMK_COMBO(name, combo_bindings, keypos, combo_layers) \
/ { \ / { \
combos { \ combos { \
compatible = "zmk,combos"; \ compatible = "zmk,combos"; \
combo_ ## name { \ combo_ ## name { \
global-quick-tap-ms = <125>; \ global-quick-tap-ms = <COMBO_QUICK_TAP_MS>; \
timeout-ms = <COMBO_TERM>; \ timeout-ms = <COMBO_TERM>; \
bindings = <combo_bindings>; \ bindings = <combo_bindings>; \
key-positions = <keypos>; \ key-positions = <keypos>; \
@ -81,7 +84,7 @@
#if !defined OS_UNICODE_LEAD #if !defined OS_UNICODE_LEAD
#if HOST_OS == 2 #if HOST_OS == 2
#define OS_UNICODE_LEAD &macro_press &kp LALT // macOS #define OS_UNICODE_LEAD &macro_press &kp LALT // macOS
#elif HOST_OS == 1 #elif HOST_OS == 1
#define OS_UNICODE_LEAD &macro_tap &kp LS(LC(U)) // Linux #define OS_UNICODE_LEAD &macro_tap &kp LS(LC(U)) // Linux
#else #else
#define OS_UNICODE_LEAD &macro_tap &kp RALT &kp U // Windows + WinCompose (default) #define OS_UNICODE_LEAD &macro_tap &kp RALT &kp U // Windows + WinCompose (default)
@ -90,7 +93,7 @@
#if !defined OS_UNICODE_TRAIL #if !defined OS_UNICODE_TRAIL
#if HOST_OS == 2 #if HOST_OS == 2
#define OS_UNICODE_TRAIL &macro_release &kp LALT // macOS #define OS_UNICODE_TRAIL &macro_release &kp LALT // macOS
#elif HOST_OS == 1 #elif HOST_OS == 1
#define OS_UNICODE_TRAIL &macro_tap &kp SPACE // Linux #define OS_UNICODE_TRAIL &macro_tap &kp SPACE // Linux
#else #else
#define OS_UNICODE_TRAIL &macro_tap &kp RET // Windows + WinCompose (default) #define OS_UNICODE_TRAIL &macro_tap &kp RET // Windows + WinCompose (default)