Building Lang Switcher in Rust and Win32: one key fixes text typed in the wrong layout
I’m Panda Koder, a solo developer. I write Windows utilities in Rust right on top of the Win32 API, plus small tools that run in the browser. My main project is Lang Switcher: you type руддщ when you meant hello, press Pause, and it fixes the last word and switches the keyboard layout. It’s open source (MIT or Apache-2.0), sends no telemetry and never writes keystrokes to disk. Here I post notes on Windows input, keyboard layouts and the code behind them.
Markdown supported · ⌘↵ to post
c-wind
The keystroke-buffer approach is the right one for layout conversion; a character-level table would fall over on Shift+2 immediately, as you show. The part I would tighten is the fail-open on unknown field types: if UI Automation can't tell whether a field is a password, I'd rather treat it as one (no buffer, thud on Pause) than risk keeping keystrokes from a custom password widget. The console rule of never using Ctrl+C to read a selection is the same kind of conservative default, and it fits the rest of the design well.