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.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md
index 418faf349..6287b9530 100644
--- a/docs/custom_quantum_functions.md
+++ b/docs/custom_quantum_functions.md
@@ -323,6 +323,7 @@ uint32_t layer_state_set_user(uint32_t state) {
323* Keyboard/Revision: `uint32_t layer_state_set_kb(uint32_t state)` 323* Keyboard/Revision: `uint32_t layer_state_set_kb(uint32_t state)`
324* Keymap: `uint32_t layer_state_set_user(uint32_t state)` 324* Keymap: `uint32_t layer_state_set_user(uint32_t state)`
325 325
326
326The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status) 327The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status)
327 328
328 329
@@ -460,3 +461,31 @@ And you're done. The RGB layer indication will only work if you want it to. And
460* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)` 461* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)`
461 462
462The `val` is the value of the data that you want to write to EEPROM. And the `eeconfig_read_*` function return a 32 bit (DWORD) value from the EEPROM. 463The `val` is the value of the data that you want to write to EEPROM. And the `eeconfig_read_*` function return a 32 bit (DWORD) value from the EEPROM.
464
465# Custom Tapping Term
466
467By 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`.
468
469To enable this functionality, you need to add `#define TAPPING_TERM_PER_KEY` to your `config.h`, first.
470
471
472## Example `get_tapping_term` Implementation
473
474To change the `TAPPING TERM` based on the keycode, you'd want to add something like the following to your `keymap.c` file:
475
476```c
477uint16_t get_tapping_term(uint16_t keycode) {
478 switch (keycode) {
479 case SFT_T(KC_SPC):
480 return TAPPING_TERM + 1250;
481 case LT(1, KC_GRV):
482 return 130;
483 default:
484 return TAPPING_TERM;
485 }
486}
487```
488
489### `get_tapping_term` Function Documentation
490
491Unlike 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.