zmk/app/dts/bindings/zmk,character-map.yaml
Joel Spadin 76ffce6779 feat(behaviors): Add a send string behavior
This adds the following:

- A character map driver API, which maps Unicode code points to behavior
  bindings.

- A zmk,character-map driver which implements this API. This driver is
  designed for ROM efficiency, so it sends every value defined in the
  map to one behavior and passes any code point not in the map through
  to another. (A more flexible implementation that allows for a unique
  behavior binding per character could be added later if necessary.)

- A zmk,send-string behavior, which users can define and bind to their
  keymaps to send strings.

- A zmk_send_string() function, which queues the necessary behaviors
  to type a UTF-8 string. This is separated from the send string
  behavior since it could be used for other features such as Unicode
  key sequences, behaviors that print dynamic messages, etc.
2024-04-07 15:05:06 -05:00

28 lines
819 B
YAML

# Copyright (c) 2023, The ZMK Contributors
# SPDX-License-Identifier: MIT
description: Unicode codepoint to behavior binding mapping
compatible: "zmk,character-map"
properties:
behavior:
type: phandle
required: true
description: |
Behavior to use for a code point in the mapping (typically <&kp>).
The behavior is given one parameter which is the value for the code point
from the "map" property.
unicode-behavior:
type: phandle
description: |
Optional behavior to use for a code point not in the mapping.
The behavior is given one parameter which is the code point.
map:
type: array
required: true
description: |
List of <codepoint param> pairs. Each pair maps a codepoint to a parameter
given to "behavior" to type that code point.