zmk/app/dts/bindings/behaviors/zmk,behavior-custom-lock.yaml
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

18 lines
359 B
YAML

# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
description: Custom lock behavior variable definition
compatible: "zmk,behavior-custom-lock"
include: zero_param.yaml
child-binding:
description: Key definitions for lock variable
include: two_param.yaml
properties:
bindings:
type: phandles
required: true