aboutsummaryrefslogtreecommitdiffstats
path: root/docs/feature_advanced_keycodes.md
diff options
context:
space:
mode:
authorGravatar Fred Silberberg <fred@silberberg.xyz>2017-11-06 09:09:01 -0800
committerGravatar Jack Humbert <jack.humb@gmail.com>2017-11-06 12:09:01 -0500
commit89357b96d40f6f8189da09c3d15131e22991ed4c (patch)
treeb62722f0814bed5aee7cc11331ca1846453cb486 /docs/feature_advanced_keycodes.md
parent16843bc8c967e965a5361fe5f94abc9cd1ccc5a5 (diff)
downloadqmk_firmware-89357b96d40f6f8189da09c3d15131e22991ed4c.tar.gz
333fred layout update (#1971)
* Set up tap dance for layers on the lower button. * Refactored code to share in the users directory between my two keyboard layouts. * Small keyboard layout change. * Updated documentation on oneshot usage in macros/tap dance.
Diffstat (limited to 'docs/feature_advanced_keycodes.md')
-rw-r--r--docs/feature_advanced_keycodes.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md
index 95a20340e..d49efdc1a 100644
--- a/docs/feature_advanced_keycodes.md
+++ b/docs/feature_advanced_keycodes.md
@@ -49,6 +49,8 @@ Once you have a good feel for how layers work and what you can do, you can get m
Layers stack on top of each other in numerical order. When determining what a keypress does, QMK scans the layers from the top down, stopping when it reaches the first active layer that is not set to `KC_TRNS`. As a result if you activate a layer that is numerically lower than your current layer, and your current layer (or another layer that is active and higher than your target layer) has something other than `KC_TRNS`, that is the key that will be sent, not the key on the layer you just activated. This is the cause of most people's "why doesn't my layer get switched" problem.
+Sometimes, you might want to switch between layers in a macro or as part of a tap dance routine. `layer_on` activates a layer, and `layer_off` deactivates it. More layer-related functions can be found in [action_layer.h](../tmk_core/common/action_layer.h).
+
# Modifier keys
These functions allow you to combine a mod with a keycode. When pressed the keydown for the mod will be sent first, and then *kc* will be sent. When released the keyup for *kc* will be sent and then the mod will be sent.
@@ -145,6 +147,8 @@ You can control the behavior of one shot keys by defining these in `config.h`:
* `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](#mod-tap), not the `KC_*` codes.
* `OSL(layer)` - momentary switch to *layer*.
+Sometimes, you want to activate a one-shot layer as part of a macro or tap dance routine. To do this, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. For more complicated actions, take a look at the oneshot implementation in [`process_record`](../tmk_core/common/action.c#L429).
+
## Permissive Hold
As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option: