diff --git a/keyboards/cantor/keymaps/struckmb/rules.mk b/keyboards/cantor/keymaps/struckmb/rules.mk index e5ddcae8..9a56408f 100644 --- a/keyboards/cantor/keymaps/struckmb/rules.mk +++ b/keyboards/cantor/keymaps/struckmb/rules.mk @@ -1 +1,2 @@ TAP_DANCE_ENABLE = yes + diff --git a/users/struckmb/bs_tap_dance.c b/users/struckmb/bs_tap_dance.c index eb9b1dd2..0aef45e4 100644 --- a/users/struckmb/bs_tap_dance.c +++ b/users/struckmb/bs_tap_dance.c @@ -29,32 +29,32 @@ void symL_finished(tap_dance_state_t *state, void *user_data) { switch (td_state) { case TD_SINGLE_TAP: # ifdef QWERTY_ENABLE - if (LAYER_QWERTY == current_layer) register_code(DE_A); + if (LAYER_QWERTY == current_layer) register_code16(DE_A); # endif // QWERTY_ENABLE # ifdef BONE_ENABLE - if (LAYER_BONE == current_layer) register_code(DE_C); + if (LAYER_BONE == current_layer) register_code16(DE_C); # endif // BONE_ENABLE # ifdef COLEMAK_DH_ENABLE - if (LAYER_COLEMAK_DH == current_layer) register_code(DE_A); + if (LAYER_COLEMAK_DH == current_layer) register_code16(DE_A); # endif // COLEMAK_DH_ENABLE break; case TD_DOUBLE_SINGLE_TAP: // Allow nesting of 2 parens `((` within tapping term # ifdef QWERTY_ENABLE if (LAYER_QWERTY == current_layer) { - tap_code(DE_A); - register_code(DE_A); + tap_code16(DE_A); + register_code16(DE_A); } # endif // QWERTY_ENABLE # ifdef BONE_ENABLE if (LAYER_BONE == current_layer) { - tap_code(DE_C); - register_code(DE_C); + tap_code16(DE_C); + register_code16(DE_C); } # endif // BONE_ENABLE # ifdef COLEMAK_DH_ENABLE if (LAYER_COLEMAK_DH == current_layer) { - tap_code(DE_A); - register_code(DE_A); + tap_code16(DE_A); + register_code16(DE_A); } # endif // COLEMAK_DH_ENABLE break; @@ -73,13 +73,13 @@ void symL_reset(tap_dance_state_t *state, void *user_data) { case TD_SINGLE_TAP: case TD_DOUBLE_SINGLE_TAP: # ifdef QWERTY_ENABLE - if (LAYER_QWERTY == current_layer) unregister_code(DE_A); + if (LAYER_QWERTY == current_layer) unregister_code16(DE_A); # endif // QWERTY_ENABLE # ifdef BONE_ENABLE - if (LAYER_BONE == current_layer) unregister_code(DE_C); + if (LAYER_BONE == current_layer) unregister_code16(DE_C); # endif // BONE_ENABLE # ifdef COLEMAK_DH_ENABLE - if (LAYER_COLEMAK_DH == current_layer) unregister_code(DE_A); + if (LAYER_COLEMAK_DH == current_layer) unregister_code16(DE_A); # endif // COLEMAK_DH_ENABLE break; default: @@ -97,32 +97,32 @@ void symR_finished(tap_dance_state_t *state, void *user_data) { switch (td_state) { case TD_SINGLE_TAP: # ifdef QWERTY_ENABLE - if (LAYER_QWERTY == current_layer) register_code(DE_ODIA); + if (LAYER_QWERTY == current_layer) register_code16(DE_ODIA); # endif // QWERTY_ENABLE # ifdef BONE_ENABLE - if (LAYER_BONE == current_layer) register_code(DE_G); + if (LAYER_BONE == current_layer) register_code16(DE_G); # endif // BONE_ENABLE # ifdef COLEMAK_DH_ENABLE - if (LAYER_COLEMAK_DH == current_layer) register_code(DE_O); + if (LAYER_COLEMAK_DH == current_layer) register_code16(DE_O); # endif // COLEMAK_DH_ENABLE break; case TD_DOUBLE_SINGLE_TAP: // Allow nesting of 2 key presses within tapping term # ifdef QWERTY_ENABLE if (LAYER_QWERTY == current_layer) { - tap_code(DE_ODIA); - register_code(DE_ODIA); + tap_code16(DE_ODIA); + register_code16(DE_ODIA); } # endif // QWERTY_ENABLE # ifdef BONE_ENABLE if (LAYER_BONE == current_layer) { - tap_code(DE_G); - register_code(DE_G); + tap_code16(DE_G); + register_code16(DE_G); } # endif // BONE_ENABLE # ifdef COLEMAK_DH_ENABLE if (LAYER_COLEMAK_DH == current_layer) { - tap_code(DE_O); - register_code(DE_O); + tap_code16(DE_O); + register_code16(DE_O); } # endif // COLEMAK_DH_ENABLE break; @@ -141,13 +141,13 @@ void symR_reset(tap_dance_state_t *state, void *user_data) { case TD_SINGLE_TAP: case TD_DOUBLE_SINGLE_TAP: # ifdef QWERTY_ENABLE - if (LAYER_QWERTY == current_layer) unregister_code(DE_A); + if (LAYER_QWERTY == current_layer) unregister_code16(DE_ODIA); # endif // QWERTY_ENABLE # ifdef BONE_ENABLE - if (LAYER_BONE == current_layer) unregister_code(DE_C); + if (LAYER_BONE == current_layer) unregister_code16(DE_G); # endif // BONE_ENABLE # ifdef COLEMAK_DH_ENABLE - if (LAYER_COLEMAK_DH == current_layer) unregister_code(DE_A); + if (LAYER_COLEMAK_DH == current_layer) unregister_code16(DE_O); # endif // COLEMAK_DH_ENABLE break; default: diff --git a/users/struckmb/config.h b/users/struckmb/config.h index f6bedb68..62159726 100644 --- a/users/struckmb/config.h +++ b/users/struckmb/config.h @@ -9,3 +9,10 @@ // #define GAME_ENABLE (left hand qwerty + right hand arrows and numbers) // #define ASETNIOP_ENABLE (corded writing) // #define ARTSENIO_ENABLE (one handed writing) + +#ifdef TAP_DANCE_ENABLE +# define TAPPING_TERM 120 +# ifdef DYNAMIC_TAPPING_TERM_ENABLE +# define DYNAMIC_TAPPING_TERM_INCREMENT 10 +# endif // DYNAMIC_TAPPING_TERM_ENABLE +#endif // TAP_DANCE_ENABLED diff --git a/users/struckmb/rules.mk b/users/struckmb/rules.mk index d3725f8f..0fc6ab9c 100644 --- a/users/struckmb/rules.mk +++ b/users/struckmb/rules.mk @@ -2,3 +2,7 @@ OS_DETECTION_ENABLE = yes # Userspace code SRC += struckmb.c + +ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) + DYNAMIC_TAPPING_TERM_ENABLE = yes +endif diff --git a/users/struckmb/struckmb.h b/users/struckmb/struckmb.h index b82ce276..76ed2f89 100644 --- a/users/struckmb/struckmb.h +++ b/users/struckmb/struckmb.h @@ -301,10 +301,14 @@ void symR_reset(tap_dance_state_t *state, void *user_data); * \ │ / │ { │ } │ * ? │ ( │ ) │ - │ : * ───┼───┼───┼───┼─── ───┼───┼───┼───┼─── * # │ $ │ | │ ~ │ ´ + │ % │ " │ ' │ ; + * (with dynamic tapping term enabled:) * ┌───┬───┬───┐ ┌───┬───┬───┐ - * │ ° │Sft│ ` │ │AGr│Sft│CWT│ + * │PTT│Sft│TT+│ │TT-│Spc│CWT│ + * └───┴───┴───┘ └───┴───┴───┘ + * * (otherwise:) * + * ┌───┬───┬───┐ ┌───┬───┬───┐ + * │ ° │Sft│ ` │ │AGr│Spc│CWT│ * └───┴───┴───┘ └───┴───┴───┘ - * * * */ #define _SL1_5_ DE_AT, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC #define _SL2_5_ DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR @@ -320,9 +324,15 @@ void symR_reset(tap_dance_state_t *state, void *user_data); #define _SR2_6_ _SR2_5_, KC_RCTL #define _SR3_6_ _SR3_5_, KC_RGUI // -#define _SL4_2_ KC_LSFT, DE_GRV -#define _SL4_3_ DE_DEG, _SL4_2_ -#define _SR4_2_ KC_RALT, KC_LSFT +#ifdef DYNAMIC_TAPPING_TERM_ENABLE +# define _SL4_2_ KC_LSFT, DT_DOWN +# define _SL4_3_ DT_PRNT, _SL4_2_ +# define _SR4_2_ DT_UP, KC_SPC +#else +# define _SL4_2_ KC_LSFT, DE_GRV +# define _SL4_3_ DE_DEG, _SL4_2_ +# define _SR4_2_ KC_RALT, KC_SPC +#endif // DYNAMIC_TAPPING_TERM_ENABLE #define _SR4_3_ _SR4_2_, CW_TOGG // #define _SYMBOLS_3x5_ _SL1_5_, _SR1_5_, _SL2_5_, _SR2_5_, _SL3_5_, _SR3_5_