mirror of
https://github.com/lhns/steam-frame-nix.git
synced 2026-10-06 03:00:13 +02:00
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.
12 lines
641 B
Nix
12 lines
641 B
Nix
# Tests of the controller bridge (flake check `vr-keyboard-controllers`):
|
|
# tip and laser relative to the keyboard, the hub's page px
|
|
# (tests/geometry.test.mjs); the bridge's adaptive tick, demand and
|
|
# touch-off mode with a fake clock, a fast approach through
|
|
# vr-keyboard-touch's tracker.js (tests/bridge.test.mjs).
|
|
{ pkgs }:
|
|
pkgs.runCommand "vr-keyboard-controllers-checks" { nativeBuildInputs = [ pkgs.nodejs ]; } ''
|
|
set -o pipefail
|
|
node ${./tests/geometry.test.mjs} ${./geometry.js} ${./hub.js} | tee $out
|
|
node ${./tests/bridge.test.mjs} ${./bridge-patch.js} ${./geometry.js} ${../vr-keyboard-touch/tracker.js} | tee -a $out
|
|
''
|