summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2024-08-12 12:24:59 +0200
committerChristoph Cullmann <cullmann@kde.org>2024-08-12 12:24:59 +0200
commitd893a9bca07582b741de07d3819eb31866de01db (patch)
tree12358080c6bab84476eaa75d4d45752b95c04878
parent01631f9d70ad43e2d3a719b42e5cb709d6eb52d8 (diff)
sync ACHORDION_STREAK fix and enable it again
-rw-r--r--common/achordion.c37
-rw-r--r--common/config.h2
2 files changed, 23 insertions, 16 deletions
diff --git a/common/achordion.c b/common/achordion.c
index 2db1113..07c1835 100644
--- a/common/achordion.c
+++ b/common/achordion.c
@@ -77,7 +77,13 @@ static void update_streak_timer(uint16_t keycode, keyrecord_t* record) {
// Calls `process_record()` with state set to RECURSING.
static void recursively_process_record(keyrecord_t* record, uint8_t state) {
achordion_state = STATE_RECURSING;
+#if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE)
+ int8_t mouse_key_tracker = get_auto_mouse_key_tracker();
+#endif
process_record(record);
+#if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE)
+ set_auto_mouse_key_tracker(mouse_key_tracker);
+#endif
achordion_state = state;
}
@@ -118,21 +124,6 @@ static void settle_as_tap(void) {
tap_hold_record.event.pressed = false;
// Plumb tap release event.
recursively_process_record(&tap_hold_record, STATE_TAPPING);
-#ifdef ACHORDION_STREAK
- update_streak_timer(keycode, record);
- if (is_streak && is_key_event && is_tap_hold && record->tap.count == 0) {
- // If we are in a streak and resolved the current tap-hold key as a tap
- // consider the next tap-hold key as active to be resolved next.
- update_streak_timer(tap_hold_keycode, &tap_hold_record);
- const uint16_t timeout = achordion_timeout(keycode);
- tap_hold_keycode = keycode;
- tap_hold_record = *record;
- hold_timer = record->event.time + timeout;
- achordion_state = STATE_UNSETTLED;
- pressed_another_key_before_release = false;
- return false;
- }
-#endif
}
bool process_achordion(uint16_t keycode, keyrecord_t* record) {
@@ -262,6 +253,22 @@ bool process_achordion(uint16_t keycode, keyrecord_t* record) {
#endif // REPEAT_KEY_ENABLE
} else {
settle_as_tap();
+
+#ifdef ACHORDION_STREAK
+ update_streak_timer(keycode, record);
+ if (is_streak && is_key_event && is_tap_hold && record->tap.count == 0) {
+ // If we are in a streak and resolved the current tap-hold key as a tap
+ // consider the next tap-hold key as active to be resolved next.
+ update_streak_timer(tap_hold_keycode, &tap_hold_record);
+ const uint16_t timeout = achordion_timeout(keycode);
+ tap_hold_keycode = keycode;
+ tap_hold_record = *record;
+ hold_timer = record->event.time + timeout;
+ achordion_state = STATE_UNSETTLED;
+ pressed_another_key_before_release = false;
+ return false;
+ }
+#endif
}
recursively_process_record(record, achordion_state); // Re-process event.
diff --git a/common/config.h b/common/config.h
index dc12f33..84cc6de 100644
--- a/common/config.h
+++ b/common/config.h
@@ -38,7 +38,7 @@
// details see https://precondition.github.io/home-row-mods
// detect typing streaks
-//#define ACHORDION_STREAK
+#define ACHORDION_STREAK
// Enable rapid switch from tap to hold, disables double tap hold auto-repeat.
#define QUICK_TAP_TERM 0