mirror of
https://github.com/lhns/steam-frame-nix.git
synced 2026-10-06 04:04:16 +02:00
VR keyboard bridge: adaptive sampling, on demand only without touch typing
The controller bridge reads the poses with setTimeout instead of a fixed 11 ms interval: the next read after (distance - 10 cm) / 2.5 m/s, 11-250 ms, the distance being the nearest tip's to the keyboard's rect plus a margin, so a hand up to 2.5 m/s is read within 10 cm before it reaches the surface (the tracker's crossing and 8 cm jump guard see 11 ms steps as before). Full rate during a demand or with a pulled trigger. Without touch typing (controllers.continuous, set by vr-keyboard-touch) no reads while the keyboard is shown until a swipe demands them; a demand starting reads at once. Bridge VERSION 6. Tests with a fake clock: bridge.test.mjs.
This commit is contained in:
1 parent
1612c162fb
commit
57ed00e29c
6 files changed
+341
-28
No files matched your search
@@ -5,7 +5,9 @@
|
||||
# - vr-keyboard-controllers/bridge-patch.js (SteamVR systemui, 8087; patch
|
||||
# "vr-keyboard-controllers"): the keyboard's pose, per hand the tip (where
|
||||
# the laser starts), the laser's hit and the trigger (geometry.js), ~90 Hz
|
||||
# while relevant or asked for (demand); CDP binding __sfuiCtlOut.
|
||||
# near the keyboard or asked for (demand), slower with distance
|
||||
# (`continuous`, set by touch typing), else only on demand; CDP binding
|
||||
# __sfuiCtlOut.
|
||||
# - vr-keyboard-controllers/relay.mjs (user service
|
||||
# vr-keyboard-controllers-relay): to Steam's SharedJSContext; demand back
|
||||
# (CDP binding __sfuiCtlIn there).
|
||||
@@ -28,6 +30,12 @@ in {
|
||||
internal = true;
|
||||
description = "The controller bridge (set by the VR keyboard features that use it).";
|
||||
};
|
||||
continuous = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
internal = true;
|
||||
description = "Sample the controllers all the time the keyboard is shown (touch typing), not only on demand (the two-handed swipe).";
|
||||
};
|
||||
files = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.path;
|
||||
readOnly = true;
|
||||
@@ -48,6 +56,7 @@ in {
|
||||
cp ${uiLib.mkPatch {
|
||||
name = "vr-keyboard-controllers";
|
||||
src = ./vr-keyboard-controllers/bridge-patch.js;
|
||||
opts = { inherit (cfg) continuous; };
|
||||
extraArgs = [ ./vr-keyboard-controllers/geometry.js ];
|
||||
}} $out
|
||||
node --check $out
|
||||
|
||||
Reference in new issue
Block a user