Docs: added mod morph page (#749)
* docs(behaviors): add mod-morph doc page * docs(behaviors): add mod-morph doc page * docs(mod-morph): add note about sent modifiers * docs(mod-morph): fixed prettier formatting
This commit is contained in:
parent
d8119cd663
commit
3893d50e13
2 changed files with 75 additions and 0 deletions
74
docs/docs/behaviors/mod-morph.md
Normal file
74
docs/docs/behaviors/mod-morph.md
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
---
|
||||||
|
title: Mod-Morph Behavior
|
||||||
|
sidebar_label: Mod-Morph
|
||||||
|
---
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
The Mod-Morph behavior sends a different keypress, depending on whether a specified modifier is being held during the keypress.
|
||||||
|
|
||||||
|
- If you tap the key by itself, the first keycode is sent.
|
||||||
|
- If you tap the key while holding the specified modifier, the second keycode is sent.
|
||||||
|
|
||||||
|
## Mod-Morph
|
||||||
|
|
||||||
|
The Mod-Morph behavior acts as one of two keycodes, depending on if the required modifier is being held during the keypress.
|
||||||
|
|
||||||
|
When the modifier is being held it is sent along with the morphed keycode. This can cause problems when the morphed keycode and modifier have an existing relationship (such as `shift-delete` or `ctrl-v` on many operating systems).
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
An example of how to implement the mod-morph "Grave Escape":
|
||||||
|
|
||||||
|
```
|
||||||
|
/ {
|
||||||
|
behaviors {
|
||||||
|
gresc: grave_escape {
|
||||||
|
compatible = "zmk,behavior-mod-morph";
|
||||||
|
label = "GRAVE_ESCAPE";
|
||||||
|
#binding-cells = <0>;
|
||||||
|
bindings = <&kp ESC>, <&kp GRAVE>;
|
||||||
|
mods = <(MOD_LGUI|MOD_LSFT|MOD_RGUI|MOD_RSFT)>;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
keymap {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that this specific mod-morph exists in ZMK by default using code `&gresc`.
|
||||||
|
|
||||||
|
### Behavior Binding
|
||||||
|
|
||||||
|
- Reference: `&gresc`
|
||||||
|
- Parameter: None
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
&gresc
|
||||||
|
```
|
||||||
|
|
||||||
|
### Mods
|
||||||
|
|
||||||
|
This is how you determine what modifiers will activate the morphed version of the keycode.
|
||||||
|
|
||||||
|
Available Modifiers:
|
||||||
|
|
||||||
|
- `MOD_LSFT`
|
||||||
|
- `MOD_RSFT`
|
||||||
|
- `MOD_LCTL`
|
||||||
|
- `MOD_RCTL`
|
||||||
|
- `MOD_LALT`
|
||||||
|
- `MOD_RALT`
|
||||||
|
- `MOD_LGUI`
|
||||||
|
- `MOD_RGUI`
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
mods = <(MOD_LGUI|MOD_LSFT|MOD_RGUI|MOD_RSFT)>;
|
||||||
|
```
|
|
@ -22,6 +22,7 @@ module.exports = {
|
||||||
"behaviors/misc",
|
"behaviors/misc",
|
||||||
"behaviors/hold-tap",
|
"behaviors/hold-tap",
|
||||||
"behaviors/mod-tap",
|
"behaviors/mod-tap",
|
||||||
|
"behaviors/mod-morph",
|
||||||
"behaviors/sticky-key",
|
"behaviors/sticky-key",
|
||||||
"behaviors/sticky-layer",
|
"behaviors/sticky-layer",
|
||||||
"behaviors/reset",
|
"behaviors/reset",
|
||||||
|
|
Loading…
Reference in a new issue