← Back to Blog

Linux Typing Is Changing: Wayland IME + EditContext Are Rewriting How Web Typing Works

Linux Typing Is Changing: Wayland IME + EditContext Are Rewriting How Web Typing Works

The short version

If you type in multiple languages, rely on dead keys or a compose key, or build typing tests/editors, Linux just changed under your fingertips. Browsers on Linux are moving to native Wayland and its modern input‑method protocols (notably text‑input‑v3), while the new EditContext API in Chromium lets custom web editors receive IME text more directly. Together these updates improve IME accuracy and positioning, but they also change event timing and how key remapping works. (reddit.com)

What actually changed under the hood

Why your IME, dead keys, and compose key feel different

How this affects typing tests and web editors

Minimal migration checklist for developers

1) Don’t treat keydown as text. Use `beforeinput`/`input` and the composition events; defer scoring until `compositionend`.

```js

let composing = false;

editable.addEventListener('compositionstart', () => composing = true);

editable.addEventListener('compositionend', () => { composing = false; finalizeRun(); });

editable.addEventListener('beforeinput', e => {

if (e.inputType === 'insertCompositionText' || e.isComposing) {

// update preview only; don’t count yet

return;

}

// handle committed inserts/deletes here

});

```

2) Respect IME selection. Don’t forcibly move the caret while `isComposing` is true; avoid intercepting Enter/Escape during composition.

3) If you render text yourself, try EditContext:

```js

if ('EditContext' in window) {

const ctx = new EditContext();

canvas.editContext = ctx;

ctx.addEventListener('textupdate', e => render(e.text, e.selectionStart, e.selectionEnd));

ctx.addEventListener('characterboundsupdate', e => positionCandidateUI(e.ranges));

}

```

4) Test with multiple IMEs (CJK, Indic) and with dead/compose keys. Validate on GNOME Wayland and Plasma Wayland.

Practical setup guide for typists (Linux desktops)

What to know about remapping on Wayland

Classic X11 tools like `xmodmap` and global key injectors don’t work the same on Wayland due to its security model (no global input snooping/injection). Prefer device‑level remappers such as keyd, input‑remapper, or xremap, which operate via `evdev/uinput` and are Wayland‑friendly. Some features (like per‑app remaps) may require compositor support or helper scripts. (github.com)

For typing‑test owners: a quick QA matrix

The road ahead

Expect incremental polish: Chromium’s text‑input‑v3 implementation (now at v3.1) continues to mature across compositors; toolkits keep handing off more responsibilities to Wayland IME paths; and EditContext is iterating through standards and compat. The bottom line: web typing on Linux is finally aligning with the platform’s native input methods—more accurate, more secure, and more consistent across apps—provided you and your code are ready for the new rules. (fosdem.org)

Article illustration

Ready to improve your typing speed?

Start a Free Typing Test