More ironing out of bugs

- Fixed the back stroke and forward stroke so it's tap hold override
- Added ability to hold repeat the tap hold shifted key
This commit is contained in:
Victor 2024-05-09 22:44:36 -05:00
parent 7a4e3d8b5c
commit f57e5fedf7
Failed to generate hash of commit
2 changed files with 21 additions and 28 deletions

View file

@ -51,37 +51,30 @@ 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 // 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) { if ( record->tap.count > 0 ) { // Key is being tapped
// Handle tap press event...
register_code16(tap_keycode);
} else { // register on press, unregister on release
// Handle tap release event... record->event.pressed ? register_code16(tap_keycode) : unregister_code16(tap_keycode);
unregister_code16(tap_keycode);
}
} else { } else { // Key is being held
// Key is being held
if (record->event.pressed) {
// Handle tap press event...
switch ( mode ) { switch ( mode ) {
case HOLD_BRACKETS: case HOLD_BRACKETS:
insert_brackets(tap_keycode, hold_keycode, WAIT_DELAY); insert_brackets(tap_keycode, hold_keycode, WAIT_DELAY);
break; break;
case HOLD_DOUBLETP: case HOLD_DOUBLETP:
double_tap(tap_keycode, WAIT_DELAY); double_tap(tap_keycode, WAIT_DELAY);
break; break;
default: default:
single_tap(tap_keycode); record->event.pressed ? register_code16(hold_keycode) : unregister_code16(hold_keycode);
break; break;
} }
} }
}
return false; return false;
} }

View file

@ -240,7 +240,7 @@ enum keycodes {
#define LAYER_SYMBOL \ #define LAYER_SYMBOL \
___x___, ___x___, KC_AMPR, TR_PERC, TR_GRV, TR_EQL, KC_HASH, KC_ASTR, ___x___, TR_DQUO, \ ___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, \ 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_____________ _LAYER_TRANS_____________, _LAYER_TRANS_____________