This commit is contained in:
Christoph Cullmann 2025-03-20 10:53:30 +01:00
parent 791be9e86b
commit 97dbf11902
No known key found for this signature in database
4 changed files with 13 additions and 6 deletions

View file

@ -77,7 +77,7 @@ file `keymap.json` in your keymap folder with the content
```json ```json
{ {
"modules": ["getreuer/achordion"] "modules": ["getreuer/tap_flow"]
} }
``` ```
@ -86,7 +86,7 @@ multiple modules like:
```json ```json
{ {
"modules": ["getreuer/achordion", "getreuer/sentence_case"] "modules": ["getreuer/tap_flow", "getreuer/sentence_case"]
} }
``` ```

View file

@ -2,7 +2,7 @@
<table> <table>
<tr><td><b>Module</b></td><td><tt>getreuer/tap_flow</tt></td></tr> <tr><td><b>Module</b></td><td><tt>getreuer/tap_flow</tt></td></tr>
<tr><td><b>Version</b></td><td>2025-03-15</td></tr> <tr><td><b>Version</b></td><td>2025-03-19</td></tr>
<tr><td><b>Maintainer</b></td><td>Pascal Getreuer (@getreuer)</td></tr> <tr><td><b>Maintainer</b></td><td>Pascal Getreuer (@getreuer)</td></tr>
<tr><td><b>License</b></td><td><a href="../LICENSE.txt">Apache 2.0</a></td></tr> <tr><td><b>License</b></td><td><a href="../LICENSE.txt">Apache 2.0</a></td></tr>
<tr><td><b>Documentation</b></td><td> <tr><td><b>Documentation</b></td><td>
@ -11,7 +11,7 @@
</table> </table>
This module is an implementation of "global quick tap" (GQT), aka "require This module is an implementation of "global quick tap" (GQT), aka "require
priori idle," for tap-hold keys. It is particularly useful for home row mods to prior idle," for tap-hold keys. It is particularly useful for home row mods to
avoid accidental mod triggers in fast typing. avoid accidental mod triggers in fast typing.
To use this module, add the following to your `keymap.json`: To use this module, add the following to your `keymap.json`:

View file

@ -31,6 +31,7 @@ ASSERT_COMMUNITY_MODULES_MIN_API_VERSION(1, 0, 0);
#error "tap_flow: Please enable Combos (COMBO_ENABLE = true) or Repeat Key (REPEAT_KEY_ENABLE = yes), or both, in rules.mk." #error "tap_flow: Please enable Combos (COMBO_ENABLE = true) or Repeat Key (REPEAT_KEY_ENABLE = yes), or both, in rules.mk."
#else #else
uint32_t last_input = 0;
uint16_t g_tap_flow_term = TAP_FLOW_TERM; uint16_t g_tap_flow_term = TAP_FLOW_TERM;
static uint16_t prev_keycode = KC_NO; static uint16_t prev_keycode = KC_NO;
@ -96,7 +97,7 @@ bool pre_process_record_tap_flow(uint16_t keycode, keyrecord_t* record) {
const uint8_t bit_mask = UINT8_C(1) << (index % 8); const uint8_t bit_mask = UINT8_C(1) << (index % 8);
if (record->event.pressed) { // On press. if (record->event.pressed) { // On press.
const uint32_t idle_time = last_input_activity_elapsed(); const uint32_t idle_time = timer_elapsed32(last_input);
uint16_t tap_flow_term = get_tap_flow(keycode, record, prev_keycode); uint16_t tap_flow_term = get_tap_flow(keycode, record, prev_keycode);
if (tap_flow_term > 500) { if (tap_flow_term > 500) {
tap_flow_term = 500; tap_flow_term = 500;
@ -156,6 +157,12 @@ bool pre_process_record_tap_flow(uint16_t keycode, keyrecord_t* record) {
prev_keycode = keycode; prev_keycode = keycode;
} }
// Update last input time. Ignore mods and mod-tap keys in this update to
// allow for chording multiple mods for hotkeys like "Ctrl+Shift+arrow".
if (!IS_MODIFIER_KEYCODE(keycode) && !IS_QK_MOD_TAP(keycode)) {
last_input = timer_read32();
}
return true; return true;
} }

View file

@ -17,7 +17,7 @@
* @brief Tap Flow module: disable HRMs during fast typing * @brief Tap Flow module: disable HRMs during fast typing
* *
* This module is an implementation of "global quick tap" (GQT), aka "require * This module is an implementation of "global quick tap" (GQT), aka "require
* priori idle," for tap-hold keys. It is particularly useful for home row mods * prior idle," for tap-hold keys. It is particularly useful for home row mods
* to avoid accidental mod triggers in fast typing. * to avoid accidental mod triggers in fast typing.
* *
* Tap Flow modifies the tap-hold decision such that when a tap-hold key is * Tap Flow modifies the tap-hold decision such that when a tap-hold key is