diff --git a/app/tests/hold-tap/conditional/enabler-other-key-out-of-order/events.patterns b/app/tests/hold-tap/balanced-conditionally-disabled/1-dn-up/events.patterns similarity index 100% rename from app/tests/hold-tap/conditional/enabler-other-key-out-of-order/events.patterns rename to app/tests/hold-tap/balanced-conditionally-disabled/1-dn-up/events.patterns diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/1-dn-up/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-disabled/1-dn-up/keycode_events.snapshot new file mode 100644 index 00000000..76a8ee5f --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/1-dn-up/keycode_events.snapshot @@ -0,0 +1,5 @@ +ht_binding_pressed: 0 new undecided hold_tap +ht_decide: 0 decided tap (balanced decision moment key-up) +kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/1-dn-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-disabled/1-dn-up/native_posix.keymap new file mode 100644 index 00000000..040cdd3e --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/1-dn-up/native_posix.keymap @@ -0,0 +1,11 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,10) + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/conditional/first-other-key-enabled/events.patterns b/app/tests/hold-tap/balanced-conditionally-disabled/2-dn-timer-up/events.patterns similarity index 100% rename from app/tests/hold-tap/conditional/first-other-key-enabled/events.patterns rename to app/tests/hold-tap/balanced-conditionally-disabled/2-dn-timer-up/events.patterns diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/2-dn-timer-up/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-disabled/2-dn-timer-up/keycode_events.snapshot new file mode 100644 index 00000000..76a8ee5f --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/2-dn-timer-up/keycode_events.snapshot @@ -0,0 +1,5 @@ +ht_binding_pressed: 0 new undecided hold_tap +ht_decide: 0 decided tap (balanced decision moment key-up) +kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/2-dn-timer-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-disabled/2-dn-timer-up/native_posix.keymap new file mode 100644 index 00000000..11d033f4 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/2-dn-timer-up/native_posix.keymap @@ -0,0 +1,11 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,500) + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/conditional/first-other-key-not-enabled/events.patterns b/app/tests/hold-tap/balanced-conditionally-disabled/3c-kcdn-dn-kcup-up/events.patterns similarity index 100% rename from app/tests/hold-tap/conditional/first-other-key-not-enabled/events.patterns rename to app/tests/hold-tap/balanced-conditionally-disabled/3c-kcdn-dn-kcup-up/events.patterns diff --git a/app/tests/hold-tap/conditional/first-other-key-not-enabled/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-disabled/3c-kcdn-dn-kcup-up/keycode_events.snapshot similarity index 63% rename from app/tests/hold-tap/conditional/first-other-key-not-enabled/keycode_events.snapshot rename to app/tests/hold-tap/balanced-conditionally-disabled/3c-kcdn-dn-kcup-up/keycode_events.snapshot index 08831e57..38bceb97 100644 --- a/app/tests/hold-tap/conditional/first-other-key-not-enabled/keycode_events.snapshot +++ b/app/tests/hold-tap/balanced-conditionally-disabled/3c-kcdn-dn-kcup-up/keycode_events.snapshot @@ -1,9 +1,7 @@ -ht_binding_pressed: 0 new undecided hold_tap -ht_decide: 0 decided tap (hold-preferred decision moment other-key-down) -kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 -kp_pressed: usage_page 0x07 keycode 0x0a implicit_mods 0x00 explicit_mods 0x00 -kp_released: usage_page 0x07 keycode 0x0a implicit_mods 0x00 explicit_mods 0x00 kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_pressed: 0 new undecided hold_tap kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +ht_decide: 0 decided tap (balanced decision moment key-up) +kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 kp_released: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/3c-kcdn-dn-kcup-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-disabled/3c-kcdn-dn-kcup-up/native_posix.keymap new file mode 100644 index 00000000..21baa447 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/3c-kcdn-dn-kcup-up/native_posix.keymap @@ -0,0 +1,13 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(1,0,10) /*d*/ + ZMK_MOCK_PRESS(0,0,100) /*mt f-shift */ + ZMK_MOCK_RELEASE(1,0,10) + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/3d-kcdn-dn-kcup-timer-up/events.patterns b/app/tests/hold-tap/balanced-conditionally-disabled/3d-kcdn-dn-kcup-timer-up/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/3d-kcdn-dn-kcup-timer-up/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/3d-kcdn-dn-kcup-timer-up/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-disabled/3d-kcdn-dn-kcup-timer-up/keycode_events.snapshot new file mode 100644 index 00000000..55665057 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/3d-kcdn-dn-kcup-timer-up/keycode_events.snapshot @@ -0,0 +1,7 @@ +kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_pressed: 0 new undecided hold_tap +kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +ht_decide: 0 decided tap (balanced decision moment timer) +kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/3d-kcdn-dn-kcup-timer-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-disabled/3d-kcdn-dn-kcup-timer-up/native_posix.keymap new file mode 100644 index 00000000..cd7ff384 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/3d-kcdn-dn-kcup-timer-up/native_posix.keymap @@ -0,0 +1,13 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(1,0,10) /* d */ + ZMK_MOCK_PRESS(0,0,100) /* mt f-shift */ + ZMK_MOCK_RELEASE(1,0,400) + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/4a-dn-kcdn-timer-kcup-up/events.patterns b/app/tests/hold-tap/balanced-conditionally-disabled/4a-dn-kcdn-timer-kcup-up/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4a-dn-kcdn-timer-kcup-up/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/4a-dn-kcdn-timer-kcup-up/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-disabled/4a-dn-kcdn-timer-kcup-up/keycode_events.snapshot new file mode 100644 index 00000000..cf6a9e4b --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4a-dn-kcdn-timer-kcup-up/keycode_events.snapshot @@ -0,0 +1,7 @@ +ht_binding_pressed: 0 new undecided hold_tap +ht_decide: 0 decided tap (balanced decision moment timer) +kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/4a-dn-kcdn-timer-kcup-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-disabled/4a-dn-kcdn-timer-kcup-up/native_posix.keymap new file mode 100644 index 00000000..bdfaf9d3 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4a-dn-kcdn-timer-kcup-up/native_posix.keymap @@ -0,0 +1,14 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,200) + ZMK_MOCK_PRESS(1,0,200) + /* timer fires */ + ZMK_MOCK_RELEASE(1,0,10) + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/4b-dn-kcdn-kcup-timer-up/events.patterns b/app/tests/hold-tap/balanced-conditionally-disabled/4b-dn-kcdn-kcup-timer-up/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4b-dn-kcdn-kcup-timer-up/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/conditional/enabler-other-key-out-of-order/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-disabled/4b-dn-kcdn-kcup-timer-up/keycode_events.snapshot similarity index 86% rename from app/tests/hold-tap/conditional/enabler-other-key-out-of-order/keycode_events.snapshot rename to app/tests/hold-tap/balanced-conditionally-disabled/4b-dn-kcdn-kcup-timer-up/keycode_events.snapshot index a5b9f134..2b9f68cf 100644 --- a/app/tests/hold-tap/conditional/enabler-other-key-out-of-order/keycode_events.snapshot +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4b-dn-kcdn-kcup-timer-up/keycode_events.snapshot @@ -1,7 +1,7 @@ -kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 ht_binding_pressed: 0 new undecided hold_tap -kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 -ht_decide: 0 decided tap (hold-preferred decision moment key-up) +ht_decide: 0 decided tap (balanced decision moment other-key-up) kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 kp_released: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/4b-dn-kcdn-kcup-timer-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-disabled/4b-dn-kcdn-kcup-timer-up/native_posix.keymap new file mode 100644 index 00000000..c0fd1bd1 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4b-dn-kcdn-kcup-timer-up/native_posix.keymap @@ -0,0 +1,14 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,100) + ZMK_MOCK_PRESS(1,0,100) + ZMK_MOCK_RELEASE(1,0,200) + /* timer fires */ + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/4c-dn-kcdn-kcup-up/events.patterns b/app/tests/hold-tap/balanced-conditionally-disabled/4c-dn-kcdn-kcup-up/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4c-dn-kcdn-kcup-up/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/4c-dn-kcdn-kcup-up/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-disabled/4c-dn-kcdn-kcup-up/keycode_events.snapshot new file mode 100644 index 00000000..2b9f68cf --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4c-dn-kcdn-kcup-up/keycode_events.snapshot @@ -0,0 +1,7 @@ +ht_binding_pressed: 0 new undecided hold_tap +ht_decide: 0 decided tap (balanced decision moment other-key-up) +kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/4c-dn-kcdn-kcup-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-disabled/4c-dn-kcdn-kcup-up/native_posix.keymap new file mode 100644 index 00000000..69c19676 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4c-dn-kcdn-kcup-up/native_posix.keymap @@ -0,0 +1,14 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,10) + ZMK_MOCK_PRESS(1,0,10) + ZMK_MOCK_RELEASE(1,0,10) + ZMK_MOCK_RELEASE(0,0,10) + /* timer */ + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/4d-dn-kcdn-timer-up-kcup/events.patterns b/app/tests/hold-tap/balanced-conditionally-disabled/4d-dn-kcdn-timer-up-kcup/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4d-dn-kcdn-timer-up-kcup/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/4d-dn-kcdn-timer-up-kcup/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-disabled/4d-dn-kcdn-timer-up-kcup/keycode_events.snapshot new file mode 100644 index 00000000..d06cd1ca --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4d-dn-kcdn-timer-up-kcup/keycode_events.snapshot @@ -0,0 +1,7 @@ +ht_binding_pressed: 0 new undecided hold_tap +ht_decide: 0 decided tap (balanced decision moment key-up) +kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap +kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 diff --git a/app/tests/hold-tap/balanced-conditionally-disabled/4d-dn-kcdn-timer-up-kcup/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-disabled/4d-dn-kcdn-timer-up-kcup/native_posix.keymap new file mode 100644 index 00000000..301ef0ac --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-disabled/4d-dn-kcdn-timer-up-kcup/native_posix.keymap @@ -0,0 +1,14 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,100) + ZMK_MOCK_PRESS(1,0,100) + ZMK_MOCK_RELEASE(0,0,200) + /* timer fires */ + ZMK_MOCK_RELEASE(1,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/conditional/behavior_keymap.dtsi b/app/tests/hold-tap/balanced-conditionally-disabled/behavior_keymap.dtsi similarity index 62% rename from app/tests/hold-tap/conditional/behavior_keymap.dtsi rename to app/tests/hold-tap/balanced-conditionally-disabled/behavior_keymap.dtsi index b29859b2..fe8603c9 100644 --- a/app/tests/hold-tap/conditional/behavior_keymap.dtsi +++ b/app/tests/hold-tap/balanced-conditionally-disabled/behavior_keymap.dtsi @@ -4,15 +4,15 @@ / { behaviors { - cht_h: conditional_hold_tap_hold_preferred { + ht_bal: behavior_hold_tap_balanced { compatible = "zmk,behavior-hold-tap"; - label = "CONDITIONAL_HOLD_TAP"; + label = "HOLD_TAP_BALANCED"; #binding-cells = <2>; - flavor = "hold-preferred"; - tapping-term-ms = <1000>; + flavor = "balanced"; + tapping-term-ms = <300>; quick-tap-ms = <200>; bindings = <&kp>, <&kp>; - hold-enabler-keys = <1>; + hold-enabler-keys = <88>; }; }; @@ -22,9 +22,8 @@ default_layer { bindings = < - &cht_h LEFT_SHIFT F &kp D - &kp G - >; + &ht_bal LEFT_SHIFT F &kp J + &kp D &kp RIGHT_CONTROL>; }; }; -}; \ No newline at end of file +}; diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/1-dn-up/events.patterns b/app/tests/hold-tap/balanced-conditionally-enabled/1-dn-up/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/1-dn-up/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/1-dn-up/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-enabled/1-dn-up/keycode_events.snapshot new file mode 100644 index 00000000..76a8ee5f --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/1-dn-up/keycode_events.snapshot @@ -0,0 +1,5 @@ +ht_binding_pressed: 0 new undecided hold_tap +ht_decide: 0 decided tap (balanced decision moment key-up) +kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/1-dn-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-enabled/1-dn-up/native_posix.keymap new file mode 100644 index 00000000..040cdd3e --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/1-dn-up/native_posix.keymap @@ -0,0 +1,11 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,10) + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/2-dn-timer-up/events.patterns b/app/tests/hold-tap/balanced-conditionally-enabled/2-dn-timer-up/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/2-dn-timer-up/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/2-dn-timer-up/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-enabled/2-dn-timer-up/keycode_events.snapshot new file mode 100644 index 00000000..926174b4 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/2-dn-timer-up/keycode_events.snapshot @@ -0,0 +1,5 @@ +ht_binding_pressed: 0 new undecided hold_tap +ht_decide: 0 decided hold-timer (balanced decision moment timer) +kp_pressed: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/2-dn-timer-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-enabled/2-dn-timer-up/native_posix.keymap new file mode 100644 index 00000000..11d033f4 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/2-dn-timer-up/native_posix.keymap @@ -0,0 +1,11 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,500) + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/3c-kcdn-dn-kcup-up/events.patterns b/app/tests/hold-tap/balanced-conditionally-enabled/3c-kcdn-dn-kcup-up/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/3c-kcdn-dn-kcup-up/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/3c-kcdn-dn-kcup-up/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-enabled/3c-kcdn-dn-kcup-up/keycode_events.snapshot new file mode 100644 index 00000000..38bceb97 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/3c-kcdn-dn-kcup-up/keycode_events.snapshot @@ -0,0 +1,7 @@ +kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_pressed: 0 new undecided hold_tap +kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +ht_decide: 0 decided tap (balanced decision moment key-up) +kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/3c-kcdn-dn-kcup-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-enabled/3c-kcdn-dn-kcup-up/native_posix.keymap new file mode 100644 index 00000000..21baa447 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/3c-kcdn-dn-kcup-up/native_posix.keymap @@ -0,0 +1,13 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(1,0,10) /*d*/ + ZMK_MOCK_PRESS(0,0,100) /*mt f-shift */ + ZMK_MOCK_RELEASE(1,0,10) + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/3d-kcdn-dn-kcup-timer-up/events.patterns b/app/tests/hold-tap/balanced-conditionally-enabled/3d-kcdn-dn-kcup-timer-up/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/3d-kcdn-dn-kcup-timer-up/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/conditional/first-other-key-enabled/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-enabled/3d-kcdn-dn-kcup-timer-up/keycode_events.snapshot similarity index 82% rename from app/tests/hold-tap/conditional/first-other-key-enabled/keycode_events.snapshot rename to app/tests/hold-tap/balanced-conditionally-enabled/3d-kcdn-dn-kcup-timer-up/keycode_events.snapshot index 1d2b827e..afbb52cf 100644 --- a/app/tests/hold-tap/conditional/first-other-key-enabled/keycode_events.snapshot +++ b/app/tests/hold-tap/balanced-conditionally-enabled/3d-kcdn-dn-kcup-timer-up/keycode_events.snapshot @@ -1,7 +1,7 @@ -ht_binding_pressed: 0 new undecided hold_tap -ht_decide: 0 decided hold-interrupt (hold-preferred decision moment other-key-down) -kp_pressed: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00 kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_pressed: 0 new undecided hold_tap kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +ht_decide: 0 decided hold-timer (balanced decision moment timer) +kp_pressed: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00 kp_released: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00 ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/3d-kcdn-dn-kcup-timer-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-enabled/3d-kcdn-dn-kcup-timer-up/native_posix.keymap new file mode 100644 index 00000000..cd7ff384 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/3d-kcdn-dn-kcup-timer-up/native_posix.keymap @@ -0,0 +1,13 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(1,0,10) /* d */ + ZMK_MOCK_PRESS(0,0,100) /* mt f-shift */ + ZMK_MOCK_RELEASE(1,0,400) + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4a-dn-kcdn-timer-kcup-up/events.patterns b/app/tests/hold-tap/balanced-conditionally-enabled/4a-dn-kcdn-timer-kcup-up/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4a-dn-kcdn-timer-kcup-up/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4a-dn-kcdn-timer-kcup-up/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-enabled/4a-dn-kcdn-timer-kcup-up/keycode_events.snapshot new file mode 100644 index 00000000..242b31f2 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4a-dn-kcdn-timer-kcup-up/keycode_events.snapshot @@ -0,0 +1,7 @@ +ht_binding_pressed: 0 new undecided hold_tap +ht_decide: 0 decided hold-timer (balanced decision moment timer) +kp_pressed: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00 +kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4a-dn-kcdn-timer-kcup-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-enabled/4a-dn-kcdn-timer-kcup-up/native_posix.keymap new file mode 100644 index 00000000..bdfaf9d3 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4a-dn-kcdn-timer-kcup-up/native_posix.keymap @@ -0,0 +1,14 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,200) + ZMK_MOCK_PRESS(1,0,200) + /* timer fires */ + ZMK_MOCK_RELEASE(1,0,10) + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4b-dn-kcdn-kcup-timer-up/events.patterns b/app/tests/hold-tap/balanced-conditionally-enabled/4b-dn-kcdn-kcup-timer-up/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4b-dn-kcdn-kcup-timer-up/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4b-dn-kcdn-kcup-timer-up/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-enabled/4b-dn-kcdn-kcup-timer-up/keycode_events.snapshot new file mode 100644 index 00000000..55fd0854 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4b-dn-kcdn-kcup-timer-up/keycode_events.snapshot @@ -0,0 +1,7 @@ +ht_binding_pressed: 0 new undecided hold_tap +ht_decide: 0 decided hold-interrupt (balanced decision moment other-key-up) +kp_pressed: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00 +kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4b-dn-kcdn-kcup-timer-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-enabled/4b-dn-kcdn-kcup-timer-up/native_posix.keymap new file mode 100644 index 00000000..c0fd1bd1 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4b-dn-kcdn-kcup-timer-up/native_posix.keymap @@ -0,0 +1,14 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,100) + ZMK_MOCK_PRESS(1,0,100) + ZMK_MOCK_RELEASE(1,0,200) + /* timer fires */ + ZMK_MOCK_RELEASE(0,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4c-dn-kcdn-kcup-up/events.patterns b/app/tests/hold-tap/balanced-conditionally-enabled/4c-dn-kcdn-kcup-up/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4c-dn-kcdn-kcup-up/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4c-dn-kcdn-kcup-up/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-enabled/4c-dn-kcdn-kcup-up/keycode_events.snapshot new file mode 100644 index 00000000..55fd0854 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4c-dn-kcdn-kcup-up/keycode_events.snapshot @@ -0,0 +1,7 @@ +ht_binding_pressed: 0 new undecided hold_tap +ht_decide: 0 decided hold-interrupt (balanced decision moment other-key-up) +kp_pressed: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00 +kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0xe1 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4c-dn-kcdn-kcup-up/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-enabled/4c-dn-kcdn-kcup-up/native_posix.keymap new file mode 100644 index 00000000..69c19676 --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4c-dn-kcdn-kcup-up/native_posix.keymap @@ -0,0 +1,14 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,10) + ZMK_MOCK_PRESS(1,0,10) + ZMK_MOCK_RELEASE(1,0,10) + ZMK_MOCK_RELEASE(0,0,10) + /* timer */ + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4d-dn-kcdn-timer-up-kcup/events.patterns b/app/tests/hold-tap/balanced-conditionally-enabled/4d-dn-kcdn-timer-up-kcup/events.patterns new file mode 100644 index 00000000..fdf2b15c --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4d-dn-kcdn-timer-up-kcup/events.patterns @@ -0,0 +1,4 @@ +s/.*hid_listener_keycode/kp/p +s/.*mo_keymap_binding/mo/p +s/.*on_hold_tap_binding/ht_binding/p +s/.*decide_hold_tap/ht_decide/p \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4d-dn-kcdn-timer-up-kcup/keycode_events.snapshot b/app/tests/hold-tap/balanced-conditionally-enabled/4d-dn-kcdn-timer-up-kcup/keycode_events.snapshot new file mode 100644 index 00000000..d06cd1ca --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4d-dn-kcdn-timer-up-kcup/keycode_events.snapshot @@ -0,0 +1,7 @@ +ht_binding_pressed: 0 new undecided hold_tap +ht_decide: 0 decided tap (balanced decision moment key-up) +kp_pressed: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +kp_pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 +kp_released: usage_page 0x07 keycode 0x09 implicit_mods 0x00 explicit_mods 0x00 +ht_binding_released: 0 cleaning up hold-tap +kp_released: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/4d-dn-kcdn-timer-up-kcup/native_posix.keymap b/app/tests/hold-tap/balanced-conditionally-enabled/4d-dn-kcdn-timer-up-kcup/native_posix.keymap new file mode 100644 index 00000000..301ef0ac --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/4d-dn-kcdn-timer-up-kcup/native_posix.keymap @@ -0,0 +1,14 @@ +#include +#include +#include +#include "../behavior_keymap.dtsi" + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,100) + ZMK_MOCK_PRESS(1,0,100) + ZMK_MOCK_RELEASE(0,0,200) + /* timer fires */ + ZMK_MOCK_RELEASE(1,0,10) + >; +}; \ No newline at end of file diff --git a/app/tests/hold-tap/balanced-conditionally-enabled/behavior_keymap.dtsi b/app/tests/hold-tap/balanced-conditionally-enabled/behavior_keymap.dtsi new file mode 100644 index 00000000..2e04fb6d --- /dev/null +++ b/app/tests/hold-tap/balanced-conditionally-enabled/behavior_keymap.dtsi @@ -0,0 +1,29 @@ +#include +#include +#include + +/ { + behaviors { + ht_bal: behavior_hold_tap_balanced { + compatible = "zmk,behavior-hold-tap"; + label = "HOLD_TAP_BALANCED"; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <300>; + quick-tap-ms = <200>; + bindings = <&kp>, <&kp>; + hold-enabler-keys = <1 2 3>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + label ="Default keymap"; + + default_layer { + bindings = < + &ht_bal LEFT_SHIFT F &kp J + &kp D &kp RIGHT_CONTROL>; + }; + }; +}; diff --git a/app/tests/hold-tap/conditional/enabler-other-key-out-of-order/native_posix.keymap b/app/tests/hold-tap/conditional/enabler-other-key-out-of-order/native_posix.keymap deleted file mode 100644 index 657d71df..00000000 --- a/app/tests/hold-tap/conditional/enabler-other-key-out-of-order/native_posix.keymap +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include -#include -#include "../behavior_keymap.dtsi" - -&kscan { - events = < - ZMK_MOCK_PRESS(0,1,100) /* enabled other key pressed */ - ZMK_MOCK_PRESS(0,0,100) /* cht pressed */ - ZMK_MOCK_RELEASE(0,1,100) /* enabled other key released */ - ZMK_MOCK_RELEASE(0,0,10) /* cht released */ - /* timer fires */ - >; -}; diff --git a/app/tests/hold-tap/conditional/first-other-key-enabled/native_posix.keymap b/app/tests/hold-tap/conditional/first-other-key-enabled/native_posix.keymap deleted file mode 100644 index 143ab428..00000000 --- a/app/tests/hold-tap/conditional/first-other-key-enabled/native_posix.keymap +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include -#include -#include "../behavior_keymap.dtsi" - -&kscan { - events = < - ZMK_MOCK_PRESS(0,0,100) /* cht pressed */ - ZMK_MOCK_PRESS(0,1,100) /* enabled other key pressed */ - ZMK_MOCK_RELEASE(0,1,100) /* enabled other key released */ - ZMK_MOCK_RELEASE(0,0,10) /* cht released */ - /* timer fires */ - >; -}; diff --git a/app/tests/hold-tap/conditional/first-other-key-not-enabled/native_posix.keymap b/app/tests/hold-tap/conditional/first-other-key-not-enabled/native_posix.keymap deleted file mode 100644 index 27e848b7..00000000 --- a/app/tests/hold-tap/conditional/first-other-key-not-enabled/native_posix.keymap +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include -#include "../behavior_keymap.dtsi" - -&kscan { - events = < - ZMK_MOCK_PRESS(0,0,100) /* cht pressed */ - ZMK_MOCK_PRESS(1,0,100) /* disabled other key pressed */ - ZMK_MOCK_RELEASE(1,0,100) /* disabled other key released */ - ZMK_MOCK_PRESS(0,1,100) /* enabled other key pressed */ - ZMK_MOCK_RELEASE(0,1,100) /* enabled other key released */ - ZMK_MOCK_RELEASE(0,0,10) /* cht released */ - /* timer fires */ - >; -};