"Behaviors" are bindings that are assigned to and triggered by key positions on keymap layers, sensors (like an encoder) or combos. They describe what happens e.g. when a certain key position is pressed or released, or an encoder triggers a rotation event. They can also be recursively invoked by other behaviors, such as macros.
Below is a summary of pre-defined behavior bindings and user-definable behaviors available in ZMK, with references to documentation pages describing them.
Key Press Behaviors
Binding | Behavior | Description |
---|
&kp | Key Press | Send keycodes to the connected host when a key is pressed |
&mt | Mod Tap | Sends a different key press depending on whether a key is held or tapped |
&kt | Key Toggle | Toggles the press of a key. If the key is not currently pressed, key toggle will press it, holding it until the key toggle is pressed again or the key is released in some other way. If the key is currently pressed, key toggle will release it |
&sk | Sticky Key | Stays pressed until another key is pressed, then is released. It is often used for modifier keys like shift, which allows typing capital letters without holding it down |
&gresc | Grave Escape | Sends Grave Accent ` keycode if shift or GUI is held, sends Escape keycode otherwise |
&caps_word | Caps Word | Behaves similar to caps lock, but automatically deactivates when any key not in a continue list is pressed, or if the caps word key is pressed again |
&key_repeat | Key Repeat | Sends again whatever keycode was last sent |
Miscellaneous Behaviors
Binding | Behavior | Description |
---|
&trans | Transparent | Passes the key press down to the next active layer in the stack for processing |
&none | None | Swallows and stops the key press, no keycode will be sent nor will the key press be passed down to the next active layer in the stack |
Layer Navigation Behaviors
Binding | Behavior | Description |
---|
&mo | Momentary Layer | Enables a layer while a key is pressed |
< | Layer-tap | Enables a layer when a key is held, and outputs a key press when the key is only tapped for a short time |
&to | To Layer | Enables a layer and disables all other layers except the default layer |
&tog | Toggle Layer | Enables a layer until the layer is manually disabled |
&sl | Sticky Layer | Activates a layer until another key is pressed, then deactivates it |
Mouse Emulation Behaviors
Reset Behaviors
Binding | Behavior | Description |
---|
&sys_reset | Reset | Resets the keyboard and re-runs the firmware flashed to the device |
&bootloader | Bootloader | Resets the keyboard and puts it into bootloader mode, allowing you to flash new firmware |
Output Selection Behaviors
Binding | Behavior | Description |
---|
&bt | Bluetooth | Completes a bluetooth action given on press, for example switching between devices |
&out | Output Selection | Allows selecting whether output is sent to the USB or bluetooth connection when both are connected |
Lighting Behaviors
Binding | Behavior | Description |
---|
&rgb_ug | RGB Underglow | Controls the RGB underglow, usually placed underneath the keyboard |
&bl | Backlight | Controls the keyboard backlighting, usually placed through or under switches |
Power Management Behaviors
Binding | Behavior | Description |
---|
&ext_power | Power management | Allows enabling or disabling the VCC power output to save power |
&soft_off | Soft off | Turns the keyboard off. |
ZMK Studio Behaviors
Binding | Behavior | Description |
---|
&studio_unlock | ZMK Studio Unlock | Unlocks the device so that ZMK Studio UI can make changes |
User-Defined Behaviors
Behavior | Description |
---|
Macros | Allows configuring a list of other behaviors to invoke when the key is pressed and/or released |
Hold-Tap | Invokes different behaviors depending on key press duration or interrupting keys. This is the basis for layer-tap and mod-tap |
Tap Dance | Invokes different behaviors corresponding to how many times a key is pressed |
Mod-Morph | Invokes different behaviors depending on whether a specified modifier is held during a key press |
Sensor Rotation | Invokes different behaviors depending on whether a sensor is rotated clockwise or counter-clockwise |