summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2023-02-11 15:23:07 -0800
committerGitHub <noreply@github.com>2023-02-12 10:23:07 +1100
commitfe02abc47921428fe6eb59ca817bfd082f0de4bf (patch)
tree5bc3f68ec782969cfed93660c21704df4b530823 /docs
parent40028437971fbca33f49e1d0b683b3b6e2dc9a61 (diff)
[Core] Tri Layer Keys (#19795)
Co-authored-by: wilba <wilba@wilba.tech> Co-authored-by: Pablo Martínez <58857054+elpekenin@users.noreply.github.com> Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/_summary.md1
-rw-r--r--docs/feature_tri_layer.md48
2 files changed, 49 insertions, 0 deletions
diff --git a/docs/_summary.md b/docs/_summary.md
index d2d4bb9b32..b038f08a4d 100644
--- a/docs/_summary.md
+++ b/docs/_summary.md
@@ -93,6 +93,7 @@
* [Swap Hands](feature_swap_hands.md)
* [Tap Dance](feature_tap_dance.md)
* [Tap-Hold Configuration](tap_hold.md)
+ * [Tri Layer](feature_tri_layer.md)
* [Unicode](feature_unicode.md)
* [Userspace](feature_userspace.md)
* [WPM Calculation](feature_wpm.md)
diff --git a/docs/feature_tri_layer.md b/docs/feature_tri_layer.md
new file mode 100644
index 0000000000..aa6c87719c
--- /dev/null
+++ b/docs/feature_tri_layer.md
@@ -0,0 +1,48 @@
+# Tri Layers :id=tri-layers
+
+This enables support for the OLKB style "Tri Layer" keycodes. These function similar to the `MO` (momentary) function key, but if both the "Lower" and "Upper" keys are pressed, it activates a third "Adjust" layer. To enable this functionality, add this line to your `rules.mk`:
+
+```make
+TRI_LAYER_ENABLE = yes
+```
+
+Note that the "upper", "lower" and "adjust" names don't have a particular significance, they are just used to identify and clarify the behavior. Layers are processed from highest numeric value to lowest, however the values are not required to be consecutive.
+
+For a detailed explanation of how the layer stack works, check out [Keymap Overview](keymap.md#keymap-and-layers).
+
+## Keycodes :id=keycodes
+
+| Keycode | Alias | Description |
+|----------------------|-----------|---------------------------------------------------------------------------------------------------------|
+| `QK_TRI_LAYER_LOWER` | `TL_LOWR` | Momentarily enables the "lower" layer. Enables the "adjust" layer if the "upper" layer is also enabled" |
+| `QK_TRI_LAYER_UPPER` | `TL_UPPR` | Momentarily enables the "upper" layer. Enables the "adjust" layer if the "lower" layer is also enabled" |
+
+## Configuration
+
+To change the default values for the layers, you can change these defines, in your `config.h`
+
+| Config name | Default | Description |
+|--------------------------|---------|------------------------------------------|
+| `TRI_LAYER_LOWER_LAYER` | `1` | Sets the default for the "lower" layer. |
+| `TRI_LAYER_UPPER_LAYER` | `2` | Sets the default for the "upper" layer. |
+| `TRI_LAYER_ADJUST_LAYER` | `3` | Sets the default for the "adjust" layer. |
+
+Eg, if you wanted to set the "Adjust" layer to be layer 5, you'd add this to your `config.h`:
+
+```c
+#define TRI_LAYER_ADJUST_LAYER 5
+```
+
+## Functions
+
+| Function name | Description |
+|----------------------------------------------|-------------------------------------------------|
+| `set_tri_layer_lower_layer(layer)` | Changes the "lower" layer*. |
+| `set_tri_layer_upper_layer(layer)` | Changes the "upper" layer*. |
+| `set_tri_layer_adjust_layer(layer)` | Changes the "adjust" layer*. |
+| `set_tri_layer_layers(lower, upper, adjust)` | Stes the "lower", "upper" and "adjust" layers*. |
+| `get_tri_layer_lower_layer()` | Gets the current "lower" layer. |
+| `get_tri_layer_upper_layer()` | Gets the current "upper" layer. |
+| `get_tri_layer_adjust_layer()` | Gets the current "adjust" layer. |
+
+!> Note: these settings are not persisent, and will be reset to the default on power loss or power cycling of the controller.