Dead Keys and Compose Keys
このコンテンツはまだ日本語訳がありません。
Use a composition table when a sequence of key presses produces a character. The table records what each press leaves pending and what the sequence eventually types. It can model dead keys, the Compose key on an XKB layout, and input methods that build or modify a character across several presses.
Dead Key
Section titled “Dead Key”On Bépo, the circumflex stays pending until a vowel takes it, as in “â”; the accent can also be typed on its own.
Types ^
[composition]commit_on_exit = false
[composition.states]"^" = { display = "◌̂" }
[composition.transitions]"" = { "^" = { next = "^" } }"^" = { spc = "^", a = "â" }The composition.transitions set the pending state with next. display controls the pending label; commit_on_exit controls what unfinished states emit.
Bépo keeps both accents pending together so the next vowel can take the circumflex and acute, as in “ấ”.
Types ấ
[composition.states."^´"]display = "◌̂́"
[composition.transitions]"^" = { "sym é" = { next = "^´" } }"^´" = { a = "ấ" }Here display names the pending label and next enters that state. The final string follows the composition.transitions rules for committed output.
Compose Key
Section titled “Compose Key”To encode the X.Org Compose rule for “é”, enter a pending state on Compose, then select the acute accent with the apostrophe key.
The pending display is blank after Compose and shows the acute accent after the apostrophe. The last key commits “é” and returns to the start state, with no pending label.
[composition]commit_on_exit = false
[composition.states]compose = { display = "" }"´" = { display = "◌́" }
[composition.transitions]"" = { compose = { next = "compose" } }compose = { "'" = { next = "´" } }"´" = { e = "é" }The composition.transitions use next for the two pending steps. The initial pending state has an empty display; commit_on_exit keeps incomplete input from committing by default.
Input Methods
Section titled “Input Methods”While typing “바다” (sea) on Dubeolsik, the final vowel moves the pending “ㄷ” from the end of one syllable to the start of the next.
The same composition table can join two vowels in “왁”, or two final consonants in “읽”. Each syllable stays pending until it is committed.
Types 왁
Types 읽
To turn “か” into “が” on JIS Kana, type the voicing mark after it; a contextual rule replaces the preceding kana.
Types が
Fields
Section titled “Fields”| Field | Use |
|---|---|
type = "dead_key" | Bind an accent prefix that emits no text by itself. |
label | Set its keycap and Inspector label. The label is not typed. |
after_keys | For a contextual dead-key rule, match the prefix before the target press. |
set | In that rule, give the target press an output object with value and delete_previous_output = true. |
composition.transitions | List each Compose step by state and key. Use "" for the start state, next for a pending step and a string for a final result. |
composition.states.<state>.display | Set the pending label to the mark or text shown on screen. Use an empty string for a pending state with no visible label. |
composition.commit_on_exit = false | Prevent incomplete states from committing their display text by default. |
Reference
Section titled “Reference”Binding behaviors#
Dead key#
{ type = "dead_key", label = "◌̂" }Declares a dead-key prefix that produces no text by itself. Define each supported composition with an after_keys rule naming this prefix and an output with delete_previous_output = true. The pair replaces the prefix’s empty output. This binding does not add an operating system Compose table.
In Try Out, an unmatched text-producing key or another dead key cancels the pending sequence with feedback and inserts no text from either key. Modifiers can still select a matching composition; Backspace cancels the prefix without removing earlier text. This scoped policy does not claim to reproduce every operating system’s fallback behavior.
The required label is displayed verbatim in the keyboard and rule references. Supply the complete legend, such as a dotted circle followed by a combining accent. The label is never typed or case-mapped. Inspect groups these keys in Notes with “This key is a dead key.”
Dead-key label#
label = "◌̂"
The complete display legend for a dead key. For example, ◌̂ identifies a circumflex prefix and ◌́ identifies an acute prefix on another layer. The renderer does not insert a dotted circle or infer an accent from the physical key ID.