The README is the complete user documentation again: features, install, two sessions, usage, the full options table (and renamed options), every feature with problem, usage, limitations, security and "remove when", UI patches at user level (DevTools on the LAN, after a Steam update), changes outside Nix, rollback and uninstall. docs/ keeps only the technical side (how the patches work, writing patches, signatures and the update procedure, the SteamVR debugger mechanics, cleanup and installer internals), linked from each feature. docs/options.md, two-sessions.md and desktop-integration.md are gone (their content is in the README).
2.8 KiB
VR keyboard: how it works
Technical details of the two VR keyboard patches. What they do and how to configure them: README, extra keys and swipe and suggestions.
Extra keys
keyboard.vr.extraKeys.enable, module steam-keyboard-patch.
- The
steam-keyboard-patchuser service (helper.mjs) injects a patch into Steam'sSharedJSContextover DevTools (127.0.0.1:8080) and re-injects it after Steam restarts; stopping it (or disabling the option) runs the unpatch, so no reboot or Steam restart is needed. - Ctrl/Alt chords and Esc are sent with
xdotool keyon:0(focus follows the VR-selected window); a toggled Ctrl/Alt is held down withxdotoolwhile the keyboard is open. - Problem characters (non-ASCII, AltGr/dead-key characters on the German
keymap) are typed with
xdotool type; everything else goes through Steam's own text emulation. On other keymaps those characters are still typed by xdotool, which is why the routing is harmless there. - The helper's command set is deliberately narrow (see the README's security note): single-key Ctrl/Alt chords, the extra keys, Ctrl/Alt hold/release and single non-ASCII/AltGr characters.
Found by signature (see finders and signatures); if one stops matching, the keyboard stays stock and the journal says why (see after a Steam update).
Swipe and suggestions
keyboard.vr.*, module vr-keyboard.
- A Steam UI patch (
vr-keyboard, injected bysteam-ui-patcheslike the other UI patches). - Swiped words are matched by shape (SHARK2-style template matching)
against a dictionary built at build time from wordfreq frequency lists
and Hunspell, both from nixpkgs (
dictionary.*: per language thewordsmost frequent wordfreq entries, shifted byfrequencyOffset, filtered by Hunspell except words at or abovekeepFrequentAbove). - The strip below/above the keyboard is a SteamVR dashboard panel
(
panel.js, a patch of SteamVR'ssystemuipage on port 8087, via the SteamVR debugger), fed by thevr-keyboard-relayuser service (relay.mjs) between the two pages. Withinsideneither the panel nor the relay runs. - With
extraKeys, non-ASCII words are typed via its xdotool helper.
Found by signature (entries vr-keyboard, vr-keyboard-panel); if one
stops matching the keyboard stays stock.
Tests: nix flake check (checks vr-keyboard: text model, corrector,
decoder accuracy on German + English) and keyboard.vr.checks for the
configured dictionary.
Debugging: window.__sfuiSwipeLog and __sfuiSwipePaths in Steam's
SharedJSContext (replay swipes with scripts/vr-keyboard-replay.mjs).