diff --git a/users/t4corun/features/taphold.c b/users/t4corun/features/taphold.c index 292862df..2f825f9e 100644 --- a/users/t4corun/features/taphold.c +++ b/users/t4corun/features/taphold.c @@ -51,36 +51,29 @@ bool process_tap_hold_key(keyrecord_t* record, uint16_t tap_keycode, uint16_t ho // https://getreuer.info/posts/keyboards/triggers/index.html#tap-vs.-long-press - if ( record->tap.count > 0 ) { - // Key is being tapped - if (record->event.pressed) { - // Handle tap press event... - register_code16(tap_keycode); - - } else { - // Handle tap release event... - unregister_code16(tap_keycode); + if ( record->tap.count > 0 ) { // Key is being tapped + + // register on press, unregister on release + record->event.pressed ? register_code16(tap_keycode) : unregister_code16(tap_keycode); + + } else { // Key is being held + + switch ( mode ) { + + case HOLD_BRACKETS: + insert_brackets(tap_keycode, hold_keycode, WAIT_DELAY); + break; + + case HOLD_DOUBLETP: + double_tap(tap_keycode, WAIT_DELAY); + break; + + default: + record->event.pressed ? register_code16(hold_keycode) : unregister_code16(hold_keycode); + break; } - } else { - // Key is being held - - if (record->event.pressed) { - // Handle tap press event... - switch ( mode ) { - case HOLD_BRACKETS: - insert_brackets(tap_keycode, hold_keycode, WAIT_DELAY); - break; - case HOLD_DOUBLETP: - double_tap(tap_keycode, WAIT_DELAY); - break; - default: - single_tap(tap_keycode); - break; - } - - } } return false; diff --git a/users/t4corun/t4corun.h b/users/t4corun/t4corun.h index ac4faef0..d72eec00 100644 --- a/users/t4corun/t4corun.h +++ b/users/t4corun/t4corun.h @@ -240,7 +240,7 @@ enum keycodes { #define LAYER_SYMBOL \ ___x___, ___x___, KC_AMPR, TR_PERC, TR_GRV, TR_EQL, KC_HASH, KC_ASTR, ___x___, TR_DQUO, \ KC_CAPS, TR_LCBR, KC_RCBR, KC_EXLM, TR_SCLN, KC_AT, KC_QUES, TR_LBRC, KC_RBRC, TR_SQUO, \ - ___x___, TR_LABK, KC_RABK, KC_BSLS, TR_PIPE, KC_DLR, KC_SLSH, TR_LPRN, KC_RPRN, TR_MINS, \ + ___x___, TR_LABK, KC_RABK, TR_BSLS, TR_PIPE, KC_DLR, TR_SLSH, TR_LPRN, KC_RPRN, TR_MINS, \ _LAYER_TRANS_____________, _LAYER_TRANS_____________