aboutsummaryrefslogtreecommitdiff
path: root/docs/custom_quantum_functions.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/custom_quantum_functions.md')
-rw-r--r--docs/custom_quantum_functions.md35
1 files changed, 30 insertions, 5 deletions
diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md
index 71a30bc7c..9c8f89ae1 100644
--- a/docs/custom_quantum_functions.md
+++ b/docs/custom_quantum_functions.md
@@ -489,14 +489,24 @@ The `val` is the value of the data that you want to write to EEPROM. And the `e
489 489
490# Custom Tapping Term 490# Custom Tapping Term
491 491
492By default, the tapping term is defined globally, and is not configurable by key. For most users, this is perfectly fine. But in come cases, dual function keys would be greatly improved by different timeouts than `LT` keys, or because some keys may be easier to hold than others. Instead of using custom key codes for each, this allows for per key configurable `TAPPING_TERM`. 492By default, the tapping term and related options (such as `IGNORE_MOD_TAP_INTERRUPT`) are defined globally, and are not configurable by key. For most users, this is perfectly fine. But in some cases, dual function keys would be greatly improved by different timeout behaviors than `LT` keys, or because some keys may be easier to hold than others. Instead of using custom key codes for each, this allows for per key configurable timeout behaviors.
493 493
494To enable this functionality, you need to add `#define TAPPING_TERM_PER_KEY` to your `config.h`, first. 494There are two configurable options to control per-key timeout behaviors:
495
496- `TAPPING_TERM_PER_KEY`
497- `IGNORE_MOD_TAP_INTERRUPT_PER_KEY`
498
499You need to add `#define` lines to your `config.h` for each feature you want.
500
501```
502#define TAPPING_TERM_PER_KEY
503#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY
504```
495 505
496 506
497## Example `get_tapping_term` Implementation 507## Example `get_tapping_term` Implementation
498 508
499To change the `TAPPING TERM` based on the keycode, you'd want to add something like the following to your `keymap.c` file: 509To change the `TAPPING_TERM` based on the keycode, you'd want to add something like the following to your `keymap.c` file:
500 510
501```c 511```c
502uint16_t get_tapping_term(uint16_t keycode) { 512uint16_t get_tapping_term(uint16_t keycode) {
@@ -511,6 +521,21 @@ uint16_t get_tapping_term(uint16_t keycode) {
511} 521}
512``` 522```
513 523
514### `get_tapping_term` Function Documentation 524## Example `get_ignore_mod_tap_interrupt` Implementation
525
526To change the `IGNORE_MOD_TAP_INTERRUPT` value based on the keycode, you'd want to add something like the following to your `keymap.c` file:
527
528```c
529bool get_ignore_mod_tap_interrupt(uint16_t keycode) {
530 switch (keycode) {
531 case SFT_T(KC_SPC):
532 return true;
533 default:
534 return false;
535 }
536}
537```
538
539## `get_tapping_term` / `get_ignore_mod_tap_interrupt` Function Documentation
515 540
516Unlike many of the other functions here, there isn't a need (or even reason) to have a quantum or keyboard level function. Only a user level function is useful here, so no need to mark it as such. 541Unlike many of the other functions here, there isn't a need (or even reason) to have a quantum or keyboard level function. Only user level functions are useful here, so no need to mark them as such.