zmk/docs/docs/behaviors/soft-off.md
Peter Johanson e5d352850c feat: Add soft on/off support.
Initial work on a soft on/off support for ZMK. Triggering soft off
puts the device into deep sleep with only a specific GPIO pin
configured to wake the device, avoiding waking from other key
presses in the matrix like the normal deep sleep.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-12-18 16:12:35 -08:00

38 lines
971 B
Markdown

---
title: Soft Off Behavior
sidebar_label: Soft Off
---
## Summary
The soft off behavior is used to force the keyboard into an off state. Depending on the specific keyboard hardware, the keyboard can be turned back on again either with a dedicated on/off button that is available, or using the reset button found on the device.
For more information, see the [Soft Off Feature](../features/soft-off.md) page.
### Behavior Binding
- Reference: `&soft_off`
Example:
```
&soft_off
```
### Configuration
#### Hold Time
By default, the keyboard will be turned off as soon as the key bound to the behavior is released, even if the key is only tapped briefly. If you would prefer that the key need be held a certain amount of time before releasing, you can set the `hold-time-ms` to a non-zero value in your keymap:
```
&soft_off {
hold-time-ms = <5000>; // Only turn off it the key is held for 5 seconds or longer.
};
/ {
keymap {
...
};
};
```