Skip to content

Commit

Permalink
Restore context_previous logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lleonini committed Aug 9, 2024
1 parent 05570c4 commit 816518e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions keyboards/adm42/v2/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ static uint16_t delayed_time = 0;
// Smaller delay: favor MOD, larger delay: favor TAP
#define DELAYED_MOD_OVERLAP (tapping_term / 6)

#define TAP_IF_LAST_PREV_TAP (tapping_term / 3)

static uint16_t retained_mod_key = 0;

void config_pending(void) {
Expand Down Expand Up @@ -407,6 +409,13 @@ bool check_tap_context(uint16_t key) {
return true;
}

if (MODTAP(key).tap != KC_BSPC &&
last_tap_kc != MODTAP(key).tap &&
last_tap_kc != KC_BSPC &&
timer_elapsed(last_tap_release_time) < TAP_IF_LAST_PREV_TAP) {
return true;
}

return false;
}

Expand Down

0 comments on commit 816518e

Please sign in to comment.