Skip to main content

Module emit

Module emit 

Source
Expand description

Linux synthetic text input.

Corrections are applied by shelling out to wtype, which drives the Wayland virtual-keyboard-v1 protocol. (A native, dependency-free implementation of that protocol is a later refinement — see DESIGN.md.)

Enums§

EmitError
An error applying a text replacement.

Functions§

anchored_replace_with_delay
Replace a word at a known position relative to end-of-line. chars_from_end is the number of Left arrows needed to walk from end-of-line back to the END of the word to replace; word_chars is the BackSpace count to remove the word once the cursor is on it.
replace
Apply an edit at the caret: press Backspace backspaces times, then type text. Uses the default per-backspace pause.
replace_around_caret_with_delay
Like replace_with_delay but also emits Delete keys (right of the caret) before typing the replacement. Used by fix-word / fix-sentence when the caret is INSIDE a word or sentence: we can’t backspace away text on the right side of the caret, so we hand the focused app BackSpace × N then Delete × M then the new text.
replace_with_delay
Like replace, but lets the caller set the pause-per-backspace in milliseconds. The pause is applied as a single sleep between the backspace burst and the replacement-text burst, scaled by the number of backspaces so longer edits wait proportionally longer.