From 67eb282815430e4c48726eb6f18d432a6579b6b3 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 5 Jan 2018 12:12:36 +1300 Subject: [PATCH] Don't swap hands if both triggers are squeezed --- .../controllers/controllerModules/webSurfaceLaserInput.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/system/controllers/controllerModules/webSurfaceLaserInput.js b/scripts/system/controllers/controllerModules/webSurfaceLaserInput.js index fa4ba3544d..3d9d7979d5 100644 --- a/scripts/system/controllers/controllerModules/webSurfaceLaserInput.js +++ b/scripts/system/controllers/controllerModules/webSurfaceLaserInput.js @@ -18,6 +18,7 @@ Script.include("/~/system/libraries/controllers.js"); (function() { function WebSurfaceLaserInput(hand) { this.hand = hand; + this.otherHand = this.hand === RIGHT_HAND ? LEFT_HAND : RIGHT_HAND; this.running = false; this.parameters = makeDispatcherModuleParameters( @@ -91,7 +92,8 @@ Script.include("/~/system/libraries/controllers.js"); this.isReady = function(controllerData) { var otherModuleRunning = this.getOtherModule().running; otherModuleRunning = otherModuleRunning && this.getDominantHand() !== this.hand; // Auto-swap to dominant hand. - var isTriggerPressed = controllerData.triggerValues[this.hand] > TRIGGER_OFF_VALUE; + var isTriggerPressed = controllerData.triggerValues[this.hand] > TRIGGER_OFF_VALUE + && controllerData.triggerValues[this.otherHand] <= TRIGGER_OFF_VALUE; if ((!otherModuleRunning || isTriggerPressed) && (this.isPointingAtOverlay(controllerData) || this.isPointingAtWebEntity(controllerData))) { this.updateAllwaysOn();