From 477feeaa9255738cba3c5f3840e355f59e9e1aca Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Sat, 15 Jun 2024 14:44:37 +0200 Subject: sync with https://github.com/getreuer/qmk-keymap --- common/achordion.h | 54 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 23 deletions(-) (limited to 'common/achordion.h') 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 . + * described at . * * @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 -- cgit v1.2.3