zmk/app/dts/behaviors.dtsi
Sophie Tyalie 34d9eb0e96 Behavior: Add custom lock functionality
Custom lock behavior can now be defined and actively used in the
keyboard.

A lock is toggled by typing a key, containing reference to the root
variable definition (`compatible = "zmk,behavior-custom-lock.yaml"`).

In order to have "A pressed -> Lock pressed -> A released" behave
correctly, this commit introduces a queue for currently pressed keys.
A release of such a key would then release the previous used behavior,
instead of the behavior the current lock state would suggest.

The size of the queue can be adjusted with `ZMK_BHV_LOCK_KEY_MAX_HELD`

Signed-off-by: Sophie Tyalie <dev@flowerpot.me>
2022-11-17 16:52:46 +01:00

21 lines
No EOL
766 B
Text

#include <behaviors/key_press.dtsi>
#include <behaviors/key_toggle.dtsi>
#include <behaviors/transparent.dtsi>
#include <behaviors/none.dtsi>
#include <behaviors/mod_tap.dtsi>
#include <behaviors/layer_tap.dtsi>
#include <behaviors/gresc.dtsi>
#include <behaviors/sticky_key.dtsi>
#include <behaviors/momentary_layer.dtsi>
#include <behaviors/toggle_layer.dtsi>
#include <behaviors/to_layer.dtsi>
#include <behaviors/reset.dtsi>
#include <behaviors/sensor_rotate_key_press.dtsi>
#include <behaviors/rgb_underglow.dtsi>
#include <behaviors/bluetooth.dtsi>
#include <behaviors/ext_power.dtsi>
#include <behaviors/outputs.dtsi>
#include <behaviors/caps_word.dtsi>
#include <behaviors/key_repeat.dtsi>
#include <behaviors/backlight.dtsi>
#include <behaviors/macros.dtsi>