diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/docs/behavior/key-press.md | 2 | ||||
-rw-r--r-- | docs/docs/behavior/layers.md | 51 | ||||
-rw-r--r-- | docs/docs/behavior/misc.md | 41 | ||||
-rw-r--r-- | docs/docs/behavior/mod-tap.md | 29 | ||||
-rw-r--r-- | docs/sidebars.js | 2 |
5 files changed, 124 insertions, 1 deletions
diff --git a/docs/docs/behavior/key-press.md b/docs/docs/behavior/key-press.md index 08296bb..1ae7e31 100644 --- a/docs/docs/behavior/key-press.md +++ b/docs/docs/behavior/key-press.md @@ -4,7 +4,7 @@ title: Key Presses ## Summary -The most basic of behaiors, is the ability to send certain keycode presses and releases in response to activating +The most basic of behaviors, is the ability to send certain keycode presses and releases in response to activating a certain key. For reference on keycode values, see the [USB HID Usage Tables](https://www.usb.org/document-library/hid-usage-tables-12). diff --git a/docs/docs/behavior/layers.md b/docs/docs/behavior/layers.md index 2388caf..3e520ca 100644 --- a/docs/docs/behavior/layers.md +++ b/docs/docs/behavior/layers.md @@ -39,3 +39,54 @@ Example: ``` &mo LOWER ``` + +## Toggle Layer + +The "toggle layer" behavior allows you to enable a layer until the layer is manually disabled. + +### Behavior Binding + +- Reference: `&tog` +- Parameter: The layer number to enable/disable, e.g. `1` + +Example: + +``` +&tog LOWER +``` + +"Toggle layer" for a : +``` +#define DEFAULT 0 +#define NAVI 1 + +#define NONE 0 + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &tog NAVI &kp KDIV &kp KMLT &kp KMIN + &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp KPLS + &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp KPLS + &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp RET + &kp NUM_0 &kp NUM_0 &kp DOT &kp RET + >; + }; + + nav_layer { + bindings = < + &tog NAVI &kp KDIV &kp KMLT &kp KMIN + &kp HOME &kp UARW &kp PGUP &kp KPLS + &kp LARW &none &kp RARW &kp KPLS + &kp END &kp DARW &kp PGDN &kp RET + &kp INS &kp INS &kp DEL &kp RET + >; + }; + }; +}; +``` + +It is possible to use "toggle layer" to have keys that raise and lower the layers as well.
\ No newline at end of file diff --git a/docs/docs/behavior/misc.md b/docs/docs/behavior/misc.md new file mode 100644 index 0000000..799c91c --- /dev/null +++ b/docs/docs/behavior/misc.md @@ -0,0 +1,41 @@ +--- +title: Miscellaneous +--- + +## Summary + +There are a few miscellaneous behaviors that are helpful when working with layers in keymaps, +in particular, with handling what happens in higher layers, and if events are passed to +the next layer or not + +## Transparent + +The transparent behavior simply ignores key position presses/releases, so they will be +passed down to the next active layer in the stack. + +### Behavior Binding + +- Reference: `&trans` +- Parameters: None + +Example: + +``` +&trans +``` + +## None + +The none behavior simply swallows and stops key position presses/releases, so they will **not** +be passed down to the next active layer in the stack. + +### Behavior Binding + +- Reference: `&none` +- Parameters: None + +Example: + +``` +&none +``` diff --git a/docs/docs/behavior/mod-tap.md b/docs/docs/behavior/mod-tap.md new file mode 100644 index 0000000..cae667e --- /dev/null +++ b/docs/docs/behavior/mod-tap.md @@ -0,0 +1,29 @@ +--- +title: Mod-Tap +--- + +## Summary + +The Mod-Tap behavior allows varying the effect of pressing and releasing a key position depending +on whether it is used with other simultaneous key presses at the same time. + +If pressed and released independently, the Mod-Tap behavior will send the press and release events +for the configure keycode. If pressed and held while another key is pressed and released, then +the configured modifiers will be applied to that _other_ key press, and no press will be generated +on the release of the Mod-Tap key. + +## Mod-Tap + +The Mod-Tap behavior either acts as a held modifier, or as a tapped keycode. + +### Behavior Binding + +- Reference: `&mt` +- Parameter #1: The modifiers to be used when activating as a modifier, e.g. `MOD_LSFT` +- Parameter #2: The keycode to sent when used as a tap, e.g. `A`, `B`. + +Example: + +``` +&mt MOD_LSFT A +``` diff --git a/docs/sidebars.js b/docs/sidebars.js index 1bd0358..be02a65 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -10,6 +10,8 @@ module.exports = { Behaviors: [ "behavior/key-press", "behavior/layers", + "behavior/misc", + "behavior/mod-tap", "behavior/lighting", ], Development: [ |