diff --git a/app/Kconfig.behaviors b/app/Kconfig.behaviors index 2b1304b2770..6c1981bea8c 100644 --- a/app/Kconfig.behaviors +++ b/app/Kconfig.behaviors @@ -25,8 +25,7 @@ config ZMK_BEHAVIOR_MOUSE_KEY_PRESS config ZMK_BEHAVIOR_SOFT_OFF bool default y - select ZMK_PM_SOFT_OFF - depends on DT_HAS_ZMK_BEHAVIOR_SOFT_OFF_ENABLED + depends on DT_HAS_ZMK_BEHAVIOR_SOFT_OFF_ENABLED && ZMK_PM_SOFT_OFF config ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON bool diff --git a/app/boards/shields/zmk_uno/boards/nrf52840dk_nrf52840.conf b/app/boards/shields/zmk_uno/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 00000000000..ac92c4d8f00 --- /dev/null +++ b/app/boards/shields/zmk_uno/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1 @@ +CONFIG_ZMK_PM_SOFT_OFF=y \ No newline at end of file diff --git a/app/dts/behaviors/soft_off.dtsi b/app/dts/behaviors/soft_off.dtsi index c68230f3231..c88e1b51f12 100644 --- a/app/dts/behaviors/soft_off.dtsi +++ b/app/dts/behaviors/soft_off.dtsi @@ -6,8 +6,9 @@ / { behaviors { - soft_off: soft_off { + /omit-if-no-ref/ soft_off: soft_off { compatible = "zmk,behavior-soft-off"; + label = "SOFTOFF"; #binding-cells = <0>; }; }; diff --git a/docs/docs/config/power.md b/docs/docs/config/power.md index 75e1b26ab8b..396456b2589 100644 --- a/docs/docs/config/power.md +++ b/docs/docs/config/power.md @@ -24,6 +24,18 @@ Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/ | `CONFIG_ZMK_SLEEP` | bool | Enable deep sleep support | n | | `CONFIG_ZMK_IDLE_SLEEP_TIMEOUT` | int | Milliseconds of inactivity before entering deep sleep | 900000 | +## Soft Off + +The [soft off feature](../features/soft-off.md) allows turning the keyboard on/off from either dedicated hardware of using the [`&soft_off` behavior](../behaviors/soft-off.md) to turn off and a reset button to turn back on again. + +### Kconfig + +Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig) + +| Config | Type | Description | Default | +| ------------------------ | ---- | ------------------------------------------------------------------- | ------- | +| `CONFIG_ZMK_PM_SOFT_OFF` | bool | Enable soft off functionality from the keymap of dedicated hardware | n | + ## External Power Control Driver for enabling or disabling power to peripherals such as displays and lighting. This driver must be configured to use [power management behaviors](../behaviors/power.md).