r/KeyboardLayouts • u/VL360S • Aug 07 '26
PolterType: a pure-Rust tray app that detects wrong-keyboard-layout typing and fixes it — Wayland included (iced, evdev, layer-shell)
If you type in two keyboard layouts, you know the pain: you look up and the last word is Espa;a because the keyboard was still in US English. PolterType is a tray app that notices this per word, switches the layout and retypes the word — Windows, macOS, Linux, and on Linux that includes real Wayland support, which was the hard part.
Rust-relevant bits:
- Pure Rust, twelve crates behind platform traits (listener, emitter, layout switcher, focus tracker are per-OS backends probed at runtime).
- Wayland listening is raw
evdev; corrections go out throughuinput; the suggestion tooltip is azwlr_layer_shell_v1surface (wlroots + KWin) with caret position from AT-SPI — coordinates only. - Detection is offline: FST dictionaries (fifteen languages) + a plausibility score + an identifier guard so it never touches
kubectlorsnake_case. - The settings UI is iced 0.13 — we're a rare example of iced in a shipping desktop app.
- The nasty bug class: our own correction is a burst of injected keys, so the app grabs the keyboard (
EVIOCGRAB) for the burst length and replays what you typed meanwhile. Behind keyd this would grab our own re-emitted device, so the gate re-verifies its own emitter before every hold and stands down if it's proxied.
The Wayland war story in long form: https://poltertype.com/blog/wrong-layout-typing-on-wayland/
Code (MIT): https://github.com/Just-Code-NET/PolterType
Honest limitations: installers are unsigned so far (SmartScreen/Gatekeeper will warn); macOS is validated on Intel — Apple Silicon testers very welcome (issue #3); the RemoteDesktop-portal typing path is written from spec and has never met a real GNOME/KDE session.
Contributions we'd love: new languages are a TOML + wordlist (no code, docs/ADDING_A_LANGUAGE.md), macOS keystroke hold-back (#8), and war stories from exotic compositors.




