zmk/app/tests/tap-dance/behavior_keymap.dtsi
Kurtis Lew 2a518d1861 feat(behavior) Add Tap-Dance (2022)
Updated Tap-Dances to enable hold functionality

Update Documentation
- Edited for clarity and added Images

Uploaded New Tests

Updates according to test results of PR#1139

Docs edits based on @petejohanson's first review

Update behavior_tap_dance.c

- Removed `behavior_tap_dance_data{}` and associated lines
- Changed `new_tap_dance` of type `static struct active_tap_dance *` to type `static int`
- Changed logic of `new_tap_dance`
- Changed behavior_count of type `int` to type `size_t`

Update behavior_tap_dance.c

Updates according to test results of PR#1139

Update behavior_tap_dance.c

Update Documentation

Attempting to debug tap-dances interrupted by tap-dances

Update tests

Further updates

commit 26eeeccbc69b1bcb4a5d48fe858cdd8917e118ba
Author: Kurtis Lew <kurtis.a.lew@gmail.com>
Date:   Fri Feb 25 15:45:34 2022 -0800

    Attempting to debug tap-dances interrupted by tap-dances

    Update tests

commit a64fb2639ce8c0ca628e1924122b920e95582d43
Author: Kurtis Lew <kurtis.a.lew@gmail.com>
Date:   Sun Feb 20 19:30:59 2022 -0800

    feat(behavior) Add Tap-Dance (2022)

    Updated Tap-Dances to enable hold functionality

    Update Documentation
    - Edited for clarity and added Images

    Uploaded New Tests

    Updates according to test results of PR#1139

    Docs edits based on @petejohanson's first review

    Update behavior_tap_dance.c

    - Removed `behavior_tap_dance_data{}` and associated lines
    - Changed `new_tap_dance` of type `static struct active_tap_dance *` to type `static int`
    - Changed logic of `new_tap_dance`
    - Changed behavior_count of type `int` to type `size_t`

    Update behavior_tap_dance.c

    Updates according to test results of PR#1139

    Update behavior_tap_dance.c

    Update Documentation

Further updates

- Tap-dances can be interrupted by another tap-dance without memory leakage
- Confirmed functionality of tap-dances with only one keybind

Single-keybind hold tests

Further updates

commit 26eeeccbc69b1bcb4a5d48fe858cdd8917e118ba
Author: Kurtis Lew <kurtis.a.lew@gmail.com>
Date:   Fri Feb 25 15:45:34 2022 -0800

    Attempting to debug tap-dances interrupted by tap-dances

    Update tests

commit a64fb2639ce8c0ca628e1924122b920e95582d43
Author: Kurtis Lew <kurtis.a.lew@gmail.com>
Date:   Sun Feb 20 19:30:59 2022 -0800

    feat(behavior) Add Tap-Dance (2022)

    Updated Tap-Dances to enable hold functionality

    Update Documentation
    - Edited for clarity and added Images

    Uploaded New Tests

    Updates according to test results of PR#1139

    Docs edits based on @petejohanson's first review

    Update behavior_tap_dance.c

    - Removed `behavior_tap_dance_data{}` and associated lines
    - Changed `new_tap_dance` of type `static struct active_tap_dance *` to type `static int`
    - Changed logic of `new_tap_dance`
    - Changed behavior_count of type `int` to type `size_t`

    Update behavior_tap_dance.c

    Updates according to test results of PR#1139

    Update behavior_tap_dance.c

    Update Documentation

Further updates

- Tap-dances can be interrupted by another tap-dance without memory leakage
- Confirmed functionality of tap-dances with only one keybind

Fix tap-dances ability to be interrupted by other tap-dances

Update tests

Remove unecessary tests

Update tests

Update behavior_tap_dance.c

Further cleanup to comments and logging

Update behavior_tap_dance.c

Update tap-dance.md
2022-03-14 13:45:10 -07:00

60 lines
1.6 KiB
Text

#include <dt-bindings/zmk/keys.h>
#include <behaviors.dtsi>
#include <dt-bindings/zmk/kscan_mock.h>
/ {
behaviors {
ht: hold_tap {
compatible = "zmk,behavior-hold-tap";
label = "HOLD_TAP";
#binding-cells = <2>;
tapping-term-ms = <200>;
quick_tap_ms = <0>;
flavor = "tap-preferred";
bindings = <&kp>, <&kp>;
};
tdm: tap_dance_mixed {
compatible = "zmk,behavior-tap-dance";
label = "TAP_DANCE_MOD";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&ht LSHIFT A>, <&ht LALT B>, <&ht LGUI C>;
};
tdb: tap_dance_basic {
compatible = "zmk,behavior-tap-dance";
label = "TAP_DANCE_BASIC";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&kp N1>, <&kp N2>, <&kp N3>;
};
td2: tap_dance_basic_2 {
compatible = "zmk,behavior-tap-dance";
label = "TAP_DANCE_BASIC_2";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&kp A>, <&kp B>, <&kp C>;
};
tds: tap_dance_single {
compatible = "zmk,behavior-tap-dance";
label = "TAP_DANCE_SINGlE";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&kp S>;
};
};
keymap {
compatible = "zmk,keymap";
label ="Default keymap";
default_layer {
bindings = <
&tdm &tds
&tdb &td2>;
};
};
};