diff options
author | Nick Brassel <[email protected]> | 2024-05-30 12:00:41 +1000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-30 12:00:41 +1000 |
commit | 6ef97172889ccd5db376b2a9f8825489e24fdac4 (patch) | |
tree | 334e3bf41c8554d4bee73a140822f95f60eb64e9 /docs/ref_functions.md | |
parent | 395766657ff98a4b1fd0dcba5917557f8acbb9e4 (diff) | |
download | qmk_firmware-6ef97172889ccd5db376b2a9f8825489e24fdac4.tar.gz qmk_firmware-6ef97172889ccd5db376b2a9f8825489e24fdac4.zip |
Vitepress conversion of docs. (#23795)
Diffstat (limited to 'docs/ref_functions.md')
-rw-r--r-- | docs/ref_functions.md | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/docs/ref_functions.md b/docs/ref_functions.md index c82c5747c2..156c9ed20b 100644 --- a/docs/ref_functions.md +++ b/docs/ref_functions.md @@ -2,7 +2,7 @@ There are a lot of hidden functions in QMK that are incredibly useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page. -## (OLKB) Tri Layers :id=olkb-tri-layers +## (OLKB) Tri Layers {#olkb-tri-layers} There are actually separate functions that you can use there, depending on what you're after. @@ -41,7 +41,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { ``` ### `update_tri_layer_state(state, x, y, z)` -The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from the [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check. +The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from the [`layer_state_set_*` functions](custom_quantum_functions#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check. There are a couple of caveats to this method: 1. You cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it. @@ -71,7 +71,7 @@ Do you want to set the default layer, so that it's retained even after you unplu To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK). -This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set. +This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio) enabled on your board, and the default layer sounds set. To configure the default layer sounds, you would want to define this in your `config.h` file, like this: @@ -83,7 +83,9 @@ To configure the default layer sounds, you would want to define this in your `co ``` -?> There are a large number of predefined songs in [quantum/audio/song_list.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/song_list.h) that you can use. +::: tip +There are a large number of predefined songs in [quantum/audio/song_list.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/song_list.h) that you can use. +::: ## Resetting the keyboard @@ -97,7 +99,7 @@ To reset to the bootloader use `QK_BOOTLOADER` or `QK_BOOT` keycode or `reset_ke ## Wiping the EEPROM (Persistent Storage) -If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). To force an EEPROM reset, use the [`EE_CLR` keycode](quantum_keycodes.md) or [Bootmagic Lite](feature_bootmagic.md) functionality. If neither of those are an option, then you can use a custom macro to do so. +If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). To force an EEPROM reset, use the [`EE_CLR` keycode](quantum_keycodes) or [Bootmagic Lite](feature_bootmagic) functionality. If neither of those are an option, then you can use a custom macro to do so. To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default. @@ -105,7 +107,9 @@ To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset m If you want to send a random character to the host computer, you can use the `tap_random_base64()` function. This [pseudorandomly](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) selects a number between 0 and 63, and then sends a key press based on that selection. (0–25 is `A`–`Z`, 26–51 is `a`–`z`, 52–61 is `0`–`9`, 62 is `+` and 63 is `/`). -?> Needless to say, but this is _not_ a cryptographically secure method of generating random Base64 keys or passwords. +::: tip +Needless to say, but this is _not_ a cryptographically secure method of generating random Base64 keys or passwords. +::: ## Software Timers |