You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
2.9 KiB

  1. # Tri Layers :id=tri-layers
  2. 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`:
  3. ```make
  4. TRI_LAYER_ENABLE = yes
  5. ```
  6. 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.
  7. For a detailed explanation of how the layer stack works, check out [Keymap Overview](keymap.md#keymap-and-layers).
  8. ## Keycodes :id=keycodes
  9. | Keycode | Alias | Description |
  10. |----------------------|-----------|---------------------------------------------------------------------------------------------------------|
  11. | `QK_TRI_LAYER_LOWER` | `TL_LOWR` | Momentarily enables the "lower" layer. Enables the "adjust" layer if the "upper" layer is also enabled" |
  12. | `QK_TRI_LAYER_UPPER` | `TL_UPPR` | Momentarily enables the "upper" layer. Enables the "adjust" layer if the "lower" layer is also enabled" |
  13. ## Configuration
  14. To change the default values for the layers, you can change these defines, in your `config.h`
  15. | Config name | Default | Description |
  16. |--------------------------|---------|------------------------------------------|
  17. | `TRI_LAYER_LOWER_LAYER` | `1` | Sets the default for the "lower" layer. |
  18. | `TRI_LAYER_UPPER_LAYER` | `2` | Sets the default for the "upper" layer. |
  19. | `TRI_LAYER_ADJUST_LAYER` | `3` | Sets the default for the "adjust" layer. |
  20. Eg, if you wanted to set the "Adjust" layer to be layer 5, you'd add this to your `config.h`:
  21. ```c
  22. #define TRI_LAYER_ADJUST_LAYER 5
  23. ```
  24. ## Functions
  25. | Function name | Description |
  26. |----------------------------------------------|-------------------------------------------------|
  27. | `set_tri_layer_lower_layer(layer)` | Changes the "lower" layer*. |
  28. | `set_tri_layer_upper_layer(layer)` | Changes the "upper" layer*. |
  29. | `set_tri_layer_adjust_layer(layer)` | Changes the "adjust" layer*. |
  30. | `set_tri_layer_layers(lower, upper, adjust)` | Sets the "lower", "upper" and "adjust" layers*. |
  31. | `get_tri_layer_lower_layer()` | Gets the current "lower" layer. |
  32. | `get_tri_layer_upper_layer()` | Gets the current "upper" layer. |
  33. | `get_tri_layer_adjust_layer()` | Gets the current "adjust" layer. |
  34. !> Note: these settings are not persistent, and will be reset to the default on power loss or power cycling of the controller.