mirror of
https://github.com/lhns/steam-frame-nix.git
synced 2026-10-06 01:00:13 +02:00
- steam-keyboard-patch.nix -> vr-keyboard-extra-keys.nix (option
keyboard.vr.extraKeys), helper.mjs -> xdotool-helper.mjs;
homeManagerModules.steam-keyboard-patch stays as an alias.
- vr-keyboard: panel.js/unpatch-panel.js/relay.mjs ->
suggestions-panel/{patch,unpatch}.js + relay.mjs; decoder.js ->
swipe-decoder.js; build.nix split into dictionary.nix and check.nix.
- modules/lib -> modules/steam-ui-patches/lib (the UI patch library).
- docs/development.md: repository layout (what runs where), runtime names.
Patch names, user services and state files are unchanged.
36 lines
1.6 KiB
JavaScript
36 lines
1.6 KiB
JavaScript
// Reverts patch.js in Steam's SharedJSContext (run by xdotool-helper.mjs on
|
|
// stop). Patched functions keep their original as __vrkbdOrig; objects Steam
|
|
// doesn't expose are in window.__vrkbdRefs/__vrkbdLayouts/__vrkbdProto/__vrkbdInst;
|
|
// the Delete-repeat listeners of a keyboard window in its __vrkbdDelDetach.
|
|
// Safe when not patched.
|
|
(() => {
|
|
const refs = window.__vrkbdRefs;
|
|
if (!refs && !window.__vrkbdProto && !window.__vrkbdLayouts) return 'not patched';
|
|
const unwrap = (obj, name) => {
|
|
const f = obj?.[name];
|
|
if (f?.__vrkbdOrig) obj[name] = f.__vrkbdOrig;
|
|
};
|
|
for (const l of window.__vrkbdLayouts || []) unwrap(l, 'rgLayout');
|
|
unwrap(SteamClient.Input, 'ControllerKeyboardSendText');
|
|
unwrap(window.__vrkbdProto, 'TypeKeyInternal');
|
|
unwrap(window.__vrkbdProto, 'RenderStandardKeyboard');
|
|
unwrap(refs?.Manager, 'GetEnterKeyLabel');
|
|
unwrap(refs?.Manager, 'HandleVirtualKeyDown');
|
|
clearInterval(window.__vrkbdHoldTimer);
|
|
|
|
for (const p of g_PopupManager.GetPopups?.() || []) p.window?.__vrkbdDelDetach?.();
|
|
const inst = window.__vrkbdInst;
|
|
if (inst) {
|
|
delete inst.__vrkbd;
|
|
delete inst.__vrkbdDelHold;
|
|
if (refs?.currentLayout) inst.setState({ standardLayout: refs.currentLayout() });
|
|
inst.forceUpdate();
|
|
}
|
|
for (const p of g_PopupManager.GetPopups?.() || []) {
|
|
p.window?.document.getElementById('vrkbd-style')?.remove();
|
|
p.window?.document.documentElement.classList.remove('vrkbd-del-hint');
|
|
}
|
|
for (const k of ['__vrkbdHoldTimer', '__vrkbdHeld', '__vrkbdInst', '__vrkbdProto', '__vrkbdLayouts', '__vrkbdRefs', '__vrkbdRendering']) delete window[k];
|
|
return 'unpatched';
|
|
})()
|