mirror of
https://github.com/lhns/steam-frame-nix.git
synced 2026-10-06 07:00:27 +02:00
Opt-in with steamFrame.keyboard.vr.enable; swipe, autocorrect and completion suggestions, Backspace drag and haptics are on under it. - vr-keyboard/patch.js (Steam UI): swipe decoder, a model of what the keyboard typed, suggestions that only replace what they typed, Backspace drag with word detents and retyping; checks its Steam internals by signature (signatures.json: vr-keyboard) and stays stock otherwise. - vr-keyboard/panel.js (SteamVR systemui) + relay.mjs (user service vr-keyboard-relay): the suggestion strip as a dashboard panel below or above the keyboard (signatures: vr-keyboard-panel). - Dictionary built from nixpkgs' wordfreq and hunspellDicts; default: the keyboard.layout language (de, fr, es, it, nl, pt, sv) plus English. - Tests: keyboard.vr.checks and the flake check vr-keyboard.
14 lines
627 B
JavaScript
14 lines
627 B
JavaScript
// Reverts patch.js in Steam's SharedJSContext (evaluated by the
|
|
// steam-ui-patches service when it stops): removes the listeners, the trail
|
|
// canvas and the candidate strip from every keyboard popup it was attached
|
|
// to, and the globals. Safe when nothing is patched.
|
|
(() => {
|
|
const S = window.__sfuiSwipe;
|
|
if (!S) return 'not patched';
|
|
for (const detach of S.docs?.values() || []) { try { detach(); } catch { /* popup gone */ } }
|
|
delete window.__sfuiSwipe;
|
|
// __sfuiSwipeLog / __sfuiSwipePaths (debugging data) are kept, so a switch
|
|
// doesn't lose the evidence of a misrecognition.
|
|
return 'unpatched';
|
|
})()
|