static bool process_tapping(keyrecord_t *record);
static bool waiting_buffer_enq(keyrecord_t record);
static void waiting_buffer_clear(void);
-#if TAPPING_TERM >= 500
static bool waiting_buffer_typed(keyevent_t event);
-#endif
static bool waiting_buffer_has_anykey_pressed(void);
static void waiting_buffer_scan_tap(void);
static void debug_tapping_key(void);
return false;
}
#endif
+ /* release a key pressed before tapping */
+ else if (!event.pressed && !waiting_buffer_typed(event)) {
+ /* Unexpected repeating occurs unless this event is processed immedately. */
+ debug("Tapping: release a key pressed before tapping\n");
+ process_action(keyp);
+ return true;
+ }
else {
// set interrupted flag when other key preesed during tapping
if (event.pressed) {
if (!tapping_key.tap.interrupted && tapping_key.tap.count > 0) {
// sequential tap.
keyp->tap = tapping_key.tap;
- keyp->tap.count += 1;
+ if (keyp->tap.count < 15) keyp->tap.count += 1;
debug("Tapping: Tap press("); debug_dec(keyp->tap.count); debug(")\n");
process_action(keyp);
tapping_key = *keyp;
waiting_buffer_tail = 0;
}
-#if TAPPING_TERM >= 500
bool waiting_buffer_typed(keyevent_t event)
{
for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) {
}
return false;
}
-#endif
bool waiting_buffer_has_anykey_pressed(void)
{