Foot Pedal Dictation Routing KDE Wayland
Routing one foot pedal to several dictation engines on KDE Wayland: why key collisions are deterministic not racy, and the xremap config that fixes them
About This Project
This project documents how to route a single foot pedal push-to-talk trigger to several dictation engines on KDE Plasma under Wayland, including a system-wide Whisper tool, a terminal AI agent with built-in voice input, and a browser dictation extension. It explains that key conflicts are not a race condition but a deterministic outcome of the input pipeline, where a global shortcut grab in KWin consumes the key before any focused application receives it. The write-up compares a static split design, which routes by verb, with an app-aware design that routes by focused window, and it assigns each engine a distinct key so that the globally grabbed key does not block the browser layer.
The implementation relies on xremap built with its KDE feature, using application and window matching with regular expressions to detect whether Konsole is running Claude Code by reading the window caption. The configuration uses modmap rather than keymap so that push-to-talk hold behaviour works, and includes explicit repeat handlers because Claude Code detects held keys through key-repeat events. The project also surveys alternative remappers such as input-remapper, keyd, AntiMicroX, and kmonad, notes their limitations on KWin Wayland, and records the window classes observed on the test machine. Claims are labelled as confirmed or inferred against specific tool versions, including Claude Code 2.1.232, input-remapper 2.2.0, and an Olympus RS-27H foot switch.
This project would be most useful to Linux users on KDE Wayland who rely on voice input and want to share a single hardware trigger across multiple applications. It may also interest developers working on input remapping, Wayland input handling, or configuring terminal-based AI tools that depend on key-repeat behaviour.