diff --git a/docs/design.md b/docs/design.md index 311af93..2d4eb30 100644 --- a/docs/design.md +++ b/docs/design.md @@ -80,6 +80,8 @@ A few overlays need special handling: - Just off a panel, the cursor stays on that panel's plane within `POINTER_EDGE_REACH`, so resize margins and window controls just outside the panel are reachable. - While the left button is held, the cursor keeps the distance it had at the press and stops re-testing collisions, so dragging past a panel's edge doesn't make it jump. +Replacing a loaded driver's files, as re-running the installer used to do, leaves SteamVR honoring the virtual controller's hand role but not its laser claim: the dashboard pointer stays unassigned until SteamVR restarts. The driver installer now leaves an unchanged driver in place. + `dashboard.laserRayWidthScale` controls the beam's width, but SteamVR only applies a change from its own settings screen or at restart, so it can't be switched per device while running. ### Handing the laser back and forth diff --git a/pointer/driver/install.sh b/pointer/driver/install.sh index 638e6d1..95bef34 100755 --- a/pointer/driver/install.sh +++ b/pointer/driver/install.sh @@ -18,13 +18,21 @@ reg='/opt/steamvr/bin/linuxarm64/vrpathreg' case ${1:-install} in install) "$root/scripts/sync.sh" >/dev/null + # Replacing the files of a driver SteamVR has loaded leaves its input bindings in a bad + # state (the 3D mouse no longer gets the laser) until SteamVR restarts, so an unchanged + # driver is left alone. "$frame" --host "set -e; test -f $src/build/driver_ft_pointer.so -rm -rf $dest; mkdir -p $dest/bin/linuxarm64 -cp -r $src/ft_pointer/. $dest/ -cp $src/build/driver_ft_pointer.so $dest/bin/linuxarm64/ +rm -rf $dest.new; mkdir -p $dest.new/bin/linuxarm64 +cp -r $src/ft_pointer/. $dest.new/ +cp $src/build/driver_ft_pointer.so $dest.new/bin/linuxarm64/ +if [ -d $dest ] && diff -r -q $dest $dest.new >/dev/null; then + rm -rf $dest.new; echo 'driver unchanged' +else + rm -rf $dest; mv $dest.new $dest + echo 'installed; restart SteamVR to load it' +fi LD_LIBRARY_PATH=/opt/steamvr/bin/linuxarm64 $reg adddriver $dest -LD_LIBRARY_PATH=/opt/steamvr/bin/linuxarm64 $reg show | grep -A3 -i 'external' -echo 'installed; restart SteamVR to load it'" ;; +LD_LIBRARY_PATH=/opt/steamvr/bin/linuxarm64 $reg show | grep -A3 -i 'external'" ;; uninstall) "$frame" --host "LD_LIBRARY_PATH=/opt/steamvr/bin/linuxarm64 $reg removedriver $dest; rm -rf $dest; echo 'removed; restart SteamVR to unload it'" ;; send)