summaryrefslogtreecommitdiffstats
path: root/Scripts/steamvr.py
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2023-09-09 17:00:36 -0700
committeryum <yum.food.vr@gmail.com>2023-09-09 17:00:36 -0700
commit9a18326aecd53c5619109dd2c5da1f26689f2f7b (patch)
tree73cf1235a2b216f272931c54dd072397d4f89fd9 /Scripts/steamvr.py
parent7d809c1779a46a11609e64e6c52b1851e86bee36 (diff)
Bugfix: fix process leak in PythonWrapper::InvokeCommandWithArgs
It now waits up to 10 seconds for a graceful exit and falls back on the equivalent of a SIGKILL. The caller is assumed to have signaled to the process through `in_cb` that an exit is desired. Also: * Fix graceful exit path of transcribe_v2.py. * Add toggle to enable/disable preview text. It is enabled by default. * Constrain transcription temperature to 0.0. This keeps latency more predictable at the cost of some accuracy.
Diffstat (limited to 'Scripts/steamvr.py')
-rw-r--r--Scripts/steamvr.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Scripts/steamvr.py b/Scripts/steamvr.py
index da07134..3e6c6c9 100644
--- a/Scripts/steamvr.py
+++ b/Scripts/steamvr.py
@@ -19,6 +19,7 @@ class InputEvent:
def pollButtonPress(
hand: str = "right",
button: str = "b",
+ ctrl = None # ThreadControl object
) -> int:
hands = {}
hands["left"] = vr.TrackedControllerRole_LeftHand
@@ -31,7 +32,7 @@ def pollButtonPress(
system = None
first = True
- while not system:
+ while ctrl.run_app and not system:
try:
system = vr.init(vr.VRApplication_Background)
except Exception as e:
@@ -42,7 +43,7 @@ def pollButtonPress(
last_packet = 0
event_high = False
- while True:
+ while ctrl.run_app:
time.sleep(0.01)
lh_idx = system.getTrackedDeviceIndexForControllerRole(hands[hand])