Add dynamic tapping term, but it's qwerky to use

This commit is contained in:
Björn Struckmeier 2024-12-08 05:37:14 -05:00
parent fc0422415b
commit 3c0a303b8c
5 changed files with 51 additions and 29 deletions

View file

@ -1 +1,2 @@
TAP_DANCE_ENABLE = yes

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -301,10 +301,14 @@ void symR_reset(tap_dance_state_t *state, void *user_data);
* \ / { } * ? ( ) - :
*
* # $ | ~ ´ + % " │ ' │ ;
* (with dynamic tapping term enabled:)
*
* ° Sft ` AGrSftCWT
* PTTSftTT+ TT-SpcCWT
*
* * (otherwise:) *
*
* ° Sft ` AGrSpcCWT
*
* * *
*/
#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
//
#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_LSFT
# 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_