aboutsummaryrefslogtreecommitdiff
path: root/docs/custom_quantum_functions.md
diff options
context:
space:
mode:
authorJames Young <18669334+noroadsleft@users.noreply.github.com>2020-05-30 13:14:59 -0700
committerGitHub <noreply@github.com>2020-05-30 13:14:59 -0700
commitfced377ac007d27f2650ccffbe0b18abcdcfe23d (patch)
treebd5b141987394a5a16cfc416bfe2b9efdb14d067 /docs/custom_quantum_functions.md
parent7b8a013826ad90714a05ea522de53adf964ab3b9 (diff)
downloadqmk_firmware-fced377ac007d27f2650ccffbe0b18abcdcfe23d.tar.gz
qmk_firmware-fced377ac007d27f2650ccffbe0b18abcdcfe23d.zip
2020 May 30 Breaking Changes Update (#9215)
* Branch point for 2020 May 30 Breaking Change * Migrate `ACTION_LAYER_TOGGLE` to `TG()` (#8954) * Migrate `ACTION_MODS_ONESHOT` to `OSM()` (#8957) * Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (#8958) * Migrate `ACTION_LAYER_MODS` to `LM()` (#8959) * Migrate `ACTION_MODS_TAP_KEY` to `MT()` (#8968) * Convert V-USB usbdrv to a submodule (#8321) * Unify Tap Hold functions and documentation (#8348) * Changing board names to prevent confusion (#8412) * Move the Keyboardio Model01 to a keyboardio/ subdir (#8499) * Move spaceman keyboards (#8830) * Migrate miscellaneous `fn_actions` entries (#8977) * Migrate `ACTION_MODS_KEY` to chained mod keycodes (#8979) * Organizing my keyboards (plaid, tartan, ergoinu) (#8537) * Refactor Lily58 to use split_common (#6260) * Refactor zinc to use split_common (#7114) * Add a message if bin/qmk doesn't work (#9000) * Fix conflicting types for 'tfp_printf' (#8269) * Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (#6480) * Refactor and updates to TKC1800 code (#8472) * Switch to qmk forks for everything (#9019) * audio refactor: replace deprecated PLAY_NOTE_ARRAY (#8484) * Audio enable corrections (2/3) (#8903) * Split HHKB to ANSI and JP layouts and Add VIA support for each (#8582) * Audio enable corrections (Part 4) (#8974) * Fix typo from PR7114 (#9171) * Augment future branch Changelogs (#8978) * Revert "Branch point for 2020 May 30 Breaking Change"
Diffstat (limited to 'docs/custom_quantum_functions.md')
-rw-r--r--docs/custom_quantum_functions.md57
1 files changed, 2 insertions, 55 deletions
diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md
index 84ae589ed..6eb144af7 100644
--- a/docs/custom_quantum_functions.md
+++ b/docs/custom_quantum_functions.md
@@ -57,7 +57,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
57 case KC_ENTER: 57 case KC_ENTER:
58 // Play a tone when enter is pressed 58 // Play a tone when enter is pressed
59 if (record->event.pressed) { 59 if (record->event.pressed) {
60 PLAY_NOTE_ARRAY(tone_qwerty); 60 PLAY_SONG(tone_qwerty);
61 } 61 }
62 return true; // Let QMK send the enter press/release events 62 return true; // Let QMK send the enter press/release events
63 default: 63 default:
@@ -438,7 +438,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
438 case KC_ENTER: 438 case KC_ENTER:
439 // Play a tone when enter is pressed 439 // Play a tone when enter is pressed
440 if (record->event.pressed) { 440 if (record->event.pressed) {
441 PLAY_NOTE_ARRAY(tone_qwerty); 441 PLAY_SONG(tone_qwerty);
442 } 442 }
443 return true; // Let QMK send the enter press/release events 443 return true; // Let QMK send the enter press/release events
444 case RGB_LYR: // This allows me to use underglow as layer indication, or as normal 444 case RGB_LYR: // This allows me to use underglow as layer indication, or as normal
@@ -486,56 +486,3 @@ And you're done. The RGB layer indication will only work if you want it to. And
486* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)` 486* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)`
487 487
488The `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. 488The `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.
489
490# Custom Tapping Term
491
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
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```
505
506
507## Example `get_tapping_term` Implementation
508
509To change the `TAPPING_TERM` based on the keycode, you'd want to add something like the following to your `keymap.c` file:
510
511```c
512uint16_t get_tapping_term(uint16_t keycode) {
513 switch (keycode) {
514 case SFT_T(KC_SPC):
515 return TAPPING_TERM + 1250;
516 case LT(1, KC_GRV):
517 return 130;
518 default:
519 return TAPPING_TERM;
520 }
521}
522```
523
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
540
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.