Repository navigation
Description
Problem & intent
type_characters (added by OpenAI's newest Linux helper, 26.1023.51421; built into cua's engine by #171 M2) types only characters the current keyboard layout can produce, and refuses the first one it cannot. In the vendor build, "éΩ🙂" on a US layout failed at é (resolve_keys failed xlib::XKeysymToKeycode keysym=0xe9); no remapping was observed (#171 research F §6.4).
Committed Unicode text already works through type_text, which pastes through the clipboard (#171's verified paste route). Paste is not always what a target accepts: fields that block paste, applications that react to key events rather than inserted text (terminals, canvas editors, games, key-driven filters), and callers that must not touch the clipboard at all.
Intent: type_characters types any Unicode character as key events, on the background route, without the clipboard.
Known approach and its costs
The established X11 technique binds a spare keycode to the needed keysym (ChangeKeyboardMapping), sends the press and release, and restores the mapping.
- The keymap is global to the X server: for the duration, the person's own typing on a shared desktop can be affected.
- Every change sends
MappingNotify, and each client refetches its keymap. A client that has not refetched when the key event arrives translates it with the old mapping and types the wrong character, so delivery needs a confirmation or a wait that is known to be safe. - The mapping must be restored on every path, including an engine crash, and two engines must not remap at once (a cross-engine lock, like Independence 4b: cua's own Linux native engine (replace sky_linux), after #117's macOS engine #171's clipboard lock).
- On the background route the event carries a keycode and modifier state that the target translates with its own keymap copy, so that copy must be current.
- Input methods may intercept the events.
On Wayland, libei's ei_text (libei 1.6) commits UTF-8 directly; that belongs to the Wayland backend ticket.
Constraints
- Layout-representable characters keep the M2 behaviour and speed; the remap applies only to characters the layout lacks.
- No vendor code; Independence 4b: cua's own Linux native engine (replace sky_linux), after #117's macOS engine #171's crate rule applies.
Success criteria
type_characters("éΩ🙂")on a US layout produces exactly that text in gedit, Chrome and a terminal on the background route.- The keymap is restored afterwards, including after the engine is killed mid-call (checked by the next engine start).
- A person typing on the same desktop during a remap gets their own characters (a harness test with concurrent key events).
capabilitiesreportstext.literalas covering any Unicode character only when this works on the session.
Open questions
- A safe wait after
MappingNotify: is there a confirmation signal per client, or only a bounded wait? - In
shareddesktop mode, is a global keymap change acceptable at all, or is thisdedicated-only? - Characters needing more than one keysym (combining sequences, emoji with modifiers).
Decision log
- 2026-10-28 (Independence 4b: cua's own Linux native engine (replace sky_linux), after #117's macOS engine #171 design, owner): typing characters absent from the layout through keymap remapping goes to the backlog; committed Unicode text stays in Independence 4b: cua's own Linux native engine (replace sky_linux), after #117's macOS engine #171 through paste. The owner ranked it below the Wayland work.
Activity
SSFSKIM commentedon Oct 28, 2026
[board] ready-for-architect: Backlog from #171 scope call; owner ranked below Wayland