From 1e3b20b66d9445f49368573902f29fd26cc5df8b Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Wed, 15 Jun 2016 15:06:36 -0700 Subject: [PATCH] Explicit check enumerated states instead of relying on order, per feedback. --- scripts/system/controllers/handControllerGrab.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 25889c9c1c..ea2c4c1653 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -361,8 +361,9 @@ function MyController(hand) { var _this = this; + var suppressedIn2D = [STATE_OFF, STATE_SEARCHING, STATE_HOLD_SEARCHING]; this.ignoreInput = function () { - return (_this.state <= STATE_HOLD_SEARCHING) && isIn2DMode(); + return (-1 !== suppressedIn2D.indexOf(_this.state)) && isIn2DMode(); }; this.update = function() {