diff options
author | Christoph Cullmann <christoph@cullmann.io> | 2024-06-15 14:44:37 +0200 |
---|---|---|
committer | Christoph Cullmann <christoph@cullmann.io> | 2024-06-15 14:44:37 +0200 |
commit | 477feeaa9255738cba3c5f3840e355f59e9e1aca (patch) | |
tree | 7d37051edc5a3705a79635630960f8fde1446dd9 /common/achordion.h | |
parent | 6cac2866d899a0349edd26fa156322353fa6aa45 (diff) |
sync with https://github.com/getreuer/qmk-keymap
Diffstat (limited to 'common/achordion.h')
-rw-r--r-- | common/achordion.h | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/common/achordion.h b/common/achordion.h index dfa8dc2..f1e08ec 100644 --- a/common/achordion.h +++ b/common/achordion.h @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Google LLC +// Copyright 2022-2024 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -53,27 +53,6 @@ #include "quantum.h" -/** - * Suppress tap-hold mods within a *typing streak* by defining - * ACHORDION_STREAK. This can help preventing accidental mod - * activation when performing a fast tapping sequence. - * This is inspired by https://sunaku.github.io/home-row-mods.html#typing-streaks - * - * Enable with: - * - * #define ACHORDION_STREAK - * - * Adjust the maximum time between key events before modifiers can be enabled - * by defining the following callback in your keymap.c: - * - * uint16_t achordion_streak_timeout(uint16_t tap_hold_keycode) { - * return 100; // Default of 100 ms. - * } - */ -#ifdef ACHORDION_STREAK -uint16_t achordion_streak_timeout(uint16_t tap_hold_keycode); -#endif - #ifdef __cplusplus extern "C" { #endif @@ -163,7 +142,7 @@ uint16_t achordion_timeout(uint16_t tap_hold_keycode); * } * * @note `mod` should be compared with `MOD_` prefixed codes, not `KC_` codes, - * described at <https://docs.qmk.fm/#/mod_tap>. + * described at <https://docs.qmk.fm/mod_tap>. * * @param mod Modifier `MOD_` code. * @return True if the modifier should be eagerly applied. @@ -180,6 +159,35 @@ bool achordion_eager_mod(uint8_t mod); bool achordion_opposite_hands(const keyrecord_t* tap_hold_record, const keyrecord_t* other_record); +/** + * Suppress tap-hold mods within a *typing streak* by defining + * ACHORDION_STREAK. This can help preventing accidental mod + * activation when performing a fast tapping sequence. + * This is inspired by + * https://sunaku.github.io/home-row-mods.html#typing-streaks + * + * Enable with: + * + * #define ACHORDION_STREAK + * + * Adjust the maximum time between key events before modifiers can be enabled + * by defining the following callback in your keymap.c: + * + * uint16_t achordion_streak_chord_timeout( + * uint16_t tap_hold_keycode, uint16_t next_keycode) { + * return 200; // Default of 200 ms. + * } + */ +#ifdef ACHORDION_STREAK +uint16_t achordion_streak_chord_timeout(uint16_t tap_hold_keycode, + uint16_t next_keycode); + +bool achordion_streak_continue(uint16_t keycode); + +/** @deprecated Use `achordion_streak_chord_timeout()` instead. */ +uint16_t achordion_streak_timeout(uint16_t tap_hold_keycode); +#endif + #ifdef __cplusplus } #endif |