|
@@ -88,16 +88,16 @@ bool process_tapping(keyrecord_t *keyp)
|
|
|
|
|
|
debug("Tapping: First tap(0->1).\n");
|
|
|
tapping_key.tap.count = 1;
|
|
|
- tapping_key.tap.interrupted = (waiting_buffer_has_anykey_pressed() ? true : false);
|
|
|
debug_tapping_key();
|
|
|
process_action(&tapping_key);
|
|
|
|
|
|
-
|
|
|
+
|
|
|
keyp->tap = tapping_key.tap;
|
|
|
+
|
|
|
return false;
|
|
|
}
|
|
|
#if TAPPING_TERM >= 500
|
|
|
-
|
|
|
+
|
|
|
else if (!event.pressed && waiting_buffer_typed(event)) {
|
|
|
|
|
|
debug("Tapping: End. No tap. Interfered by typing key\n");
|
|
@@ -110,7 +110,11 @@ bool process_tapping(keyrecord_t *keyp)
|
|
|
}
|
|
|
#endif
|
|
|
else {
|
|
|
-
|
|
|
+
|
|
|
+ if (event.pressed) {
|
|
|
+ tapping_key.tap.interrupted = true;
|
|
|
+ }
|
|
|
+
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -124,7 +128,7 @@ bool process_tapping(keyrecord_t *keyp)
|
|
|
debug_tapping_key();
|
|
|
return true;
|
|
|
}
|
|
|
- else if (is_tap_key(keyp->event.key) && event.pressed) {
|
|
|
+ else if (is_tap_key(event.key) && event.pressed) {
|
|
|
if (tapping_key.tap.count > 1) {
|
|
|
debug("Tapping: Start new tap with releasing last tap(>1).\n");
|
|
|
|
|
@@ -143,7 +147,7 @@ bool process_tapping(keyrecord_t *keyp)
|
|
|
return true;
|
|
|
}
|
|
|
else {
|
|
|
- if (!IS_NOEVENT(keyp->event)) {
|
|
|
+ if (!IS_NOEVENT(event)) {
|
|
|
debug("Tapping: key event while last tap(>0).\n");
|
|
|
}
|
|
|
process_action(keyp);
|
|
@@ -168,7 +172,7 @@ bool process_tapping(keyrecord_t *keyp)
|
|
|
tapping_key = (keyrecord_t){};
|
|
|
return true;
|
|
|
}
|
|
|
- else if (is_tap_key(keyp->event.key) && event.pressed) {
|
|
|
+ else if (is_tap_key(event.key) && event.pressed) {
|
|
|
if (tapping_key.tap.count > 1) {
|
|
|
debug("Tapping: Start new tap with releasing last timeout tap(>1).\n");
|
|
|
|
|
@@ -187,7 +191,7 @@ bool process_tapping(keyrecord_t *keyp)
|
|
|
return true;
|
|
|
}
|
|
|
else {
|
|
|
- if (!IS_NOEVENT(keyp->event)) {
|
|
|
+ if (!IS_NOEVENT(event)) {
|
|
|
debug("Tapping: key event while last timeout tap(>0).\n");
|
|
|
}
|
|
|
process_action(keyp);
|
|
@@ -197,28 +201,43 @@ bool process_tapping(keyrecord_t *keyp)
|
|
|
}
|
|
|
} else if (IS_TAPPING_RELEASED()) {
|
|
|
if (WITHIN_TAPPING_TERM(event)) {
|
|
|
- if (tapping_key.tap.count > 0 && IS_TAPPING_KEY(event.key) && event.pressed) {
|
|
|
-
|
|
|
- keyp->tap = tapping_key.tap;
|
|
|
- keyp->tap.count += 1;
|
|
|
- debug("Tapping: Tap press("); debug_dec(keyp->tap.count); debug(")\n");
|
|
|
- process_action(keyp);
|
|
|
- tapping_key = *keyp;
|
|
|
- debug_tapping_key();
|
|
|
- return true;
|
|
|
- } else if (event.pressed && is_tap_key(event.key)) {
|
|
|
-
|
|
|
- debug("Tapping: Start with interfering other tap.\n");
|
|
|
- tapping_key = *keyp;
|
|
|
- waiting_buffer_scan_tap();
|
|
|
- debug_tapping_key();
|
|
|
- return true;
|
|
|
+ if (event.pressed) {
|
|
|
+ if (IS_TAPPING_KEY(event.key)) {
|
|
|
+ if (!tapping_key.tap.interrupted && tapping_key.tap.count > 0) {
|
|
|
+
|
|
|
+ keyp->tap = tapping_key.tap;
|
|
|
+ keyp->tap.count += 1;
|
|
|
+ debug("Tapping: Tap press("); debug_dec(keyp->tap.count); debug(")\n");
|
|
|
+ process_action(keyp);
|
|
|
+ tapping_key = *keyp;
|
|
|
+ debug_tapping_key();
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+
|
|
|
+ tapping_key = *keyp;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ } else if (is_tap_key(event.key)) {
|
|
|
+
|
|
|
+ debug("Tapping: Start with interfering other tap.\n");
|
|
|
+ tapping_key = *keyp;
|
|
|
+ waiting_buffer_scan_tap();
|
|
|
+ debug_tapping_key();
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+
|
|
|
+
|
|
|
+ tapping_key.tap.interrupted = true;
|
|
|
+ process_action(keyp);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
} else {
|
|
|
- if (!IS_NOEVENT(keyp->event)) debug("Tapping: other key just after tap.\n");
|
|
|
+ if (!IS_NOEVENT(event)) debug("Tapping: other key just after tap.\n");
|
|
|
process_action(keyp);
|
|
|
return true;
|
|
|
}
|
|
|
} else {
|
|
|
+
|
|
|
|
|
|
debug("Tapping: End(Timeout after releasing last tap): ");
|
|
|
debug_event(event); debug("\n");
|
|
@@ -227,7 +246,7 @@ bool process_tapping(keyrecord_t *keyp)
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
else {
|
|
|
if (event.pressed && is_tap_key(event.key)) {
|
|
|
debug("Tapping: Start(Press tap key).\n");
|