|
@@ -27,6 +27,10 @@ __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode) { return TAPPI
|
|
# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < TAPPING_TERM)
|
|
# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < TAPPING_TERM)
|
|
# endif
|
|
# endif
|
|
|
|
|
|
|
|
+# ifdef TAPPING_FORCE_HOLD_PER_KEY
|
|
|
|
+__attribute__((weak)) bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { return false; }
|
|
|
|
+# endif
|
|
|
|
+
|
|
static keyrecord_t tapping_key = {};
|
|
static keyrecord_t tapping_key = {};
|
|
static keyrecord_t waiting_buffer[WAITING_BUFFER_SIZE] = {};
|
|
static keyrecord_t waiting_buffer[WAITING_BUFFER_SIZE] = {};
|
|
static uint8_t waiting_buffer_head = 0;
|
|
static uint8_t waiting_buffer_head = 0;
|
|
@@ -232,8 +236,13 @@ bool process_tapping(keyrecord_t *keyp) {
|
|
if (WITHIN_TAPPING_TERM(event)) {
|
|
if (WITHIN_TAPPING_TERM(event)) {
|
|
if (event.pressed) {
|
|
if (event.pressed) {
|
|
if (IS_TAPPING_KEY(event.key)) {
|
|
if (IS_TAPPING_KEY(event.key)) {
|
|
-# ifndef TAPPING_FORCE_HOLD
|
|
|
|
- if (!tapping_key.tap.interrupted && tapping_key.tap.count > 0) {
|
|
|
|
|
|
+//# ifndef TAPPING_FORCE_HOLD
|
|
|
|
+# if !defined(TAPPING_FORCE_HOLD) || defined(TAPPING_FORCE_HOLD_PER_KEY)
|
|
|
|
+ if (
|
|
|
|
+# ifdef TAPPING_FORCE_HOLD_PER_KEY
|
|
|
|
+ !get_tapping_force_hold(get_event_keycode(tapping_key.event), keyp) &&
|
|
|
|
+# endif
|
|
|
|
+ !tapping_key.tap.interrupted && tapping_key.tap.count > 0) {
|
|
// sequential tap.
|
|
// sequential tap.
|
|
keyp->tap = tapping_key.tap;
|
|
keyp->tap = tapping_key.tap;
|
|
if (keyp->tap.count < 15) keyp->tap.count += 1;
|
|
if (keyp->tap.count < 15) keyp->tap.count += 1;
|