Zum Inhalt springen

Defining Combos

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

If your layout uses two or more keys together to type something, a combo records that behavior without changing what the keys do on their own. In TOML, a chord names the physical keys; a combo assigns that chord a behavior on a particular layer.

T-34 shows how a combo adds an output without changing the individual keys: types “?”. These are the relevant lines from its base layer and chord definitions:

[chords]
comb_ques = [ "e", "n" ]
[layers.base]
default = "literal"
combos = {
comb_ques = "?",
}

Declare the key group in chords and assign it an action in combos. The layer’s default applies to single keys.

To build a Hangul syllable from simultaneously pressed keys, Semo-e (세모이) uses a chord product with banks for the onset, vowel, and optional final. This excerpt keeps one choice from each bank and the optional empty final:

[layers.base.chord_products.syllables]
normalization = "nfc"
[[layers.base.chord_products.syllables.banks]]
"k" = "ᄀ"
[[layers.base.chord_products.syllables.banks]]
"f" = "ᅡ"
[[layers.base.chord_products.syllables.banks]]
"" = ""
"s" = "ᆫ"

The product’s banks define the choices for each part of a syllable. normalization controls how outputs for the same keys are compared.

produces “가”; produces “간”. The product concatenates the selected entries in bank order and combines the letters with NFC normalization.

FieldWhat it does
[chords]Defines each chord by two or more distinct physical key IDs. Key order is not a trigger condition. A chord name cannot also name a physical key.
layers.NAME.combosMaps a named chord to its behavior on that layer. An explicit combo wins over a generated product for the same keys on that layer.
layers.NAME.chord_products.PRODUCT.banksEach bank maps whitespace-separated physical key IDs to text. Use "" = "" for an optional bank entry. Each generated nonempty combination must use at least two distinct keys and produce text.
layers.NAME.chord_products.PRODUCT.normalizationSet to "nfc". Equal normalized outputs for the same keys collapse; competing outputs need an explicit chord and combo.

If a Shift layer should inherit a chord, give that chord an explicit { type = "transparent" } combo on Shift. The layer’s single-key default does not apply. The string "transparent" would type the word instead.

Layers and lookup#

Layer combo bindings#

layers.*.combos.*

Assigns behavior to a declared chord on this layer.

An omitted combo is opaque none, not inherited. Author { type = "transparent" } explicitly to continue lookup. On a mapped destination, that transparent combo first consults the configured source layer.

Chords and key sets#

Chord membership#

[chords]

Each chord contains at least two retained stable key IDs. This table defines physical membership only; layers.*.combos defines behavior separately per layer.

Chord names and physical key IDs share one namespace. A chord name cannot duplicate a retained key ID.

Fragment: chord membership and behavior
[chords]
qu = ["g", "d"]

[layers.base]
default = "literal"
combos = { qu = "qu" }