From 060f87d14a58e16cd0039863edc90e57837b8bfb Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Fri, 23 Oct 2015 17:33:45 -0700 Subject: [PATCH] CR feedback --- examples/controllers/handControllerGrab.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index a61f52117b..29d6595c3a 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -867,10 +867,12 @@ function MyController(hand, triggerAction) { var rightController = new MyController(RIGHT_HAND, Controller.Standard.RT); var leftController = new MyController(LEFT_HAND, Controller.Standard.LT); -var mapping = Controller.newMapping("com.highfidelity.handControllerGrab"); +var MAPPING_NAME = "com.highfidelity.handControllerGrab"; + +var mapping = Controller.newMapping(MAPPING_NAME); mapping.from([Controller.Standard.RB, Controller.Standard.RT]).to(rightController.eitherTrigger); mapping.from([Controller.Standard.LB, Controller.Standard.LT]).to(leftController.eitherTrigger); -Controller.enableMapping("com.highfidelity.handControllerGrab"); +Controller.enableMapping(MAPPING_NAME); function update() { @@ -881,7 +883,7 @@ function update() { function cleanup() { rightController.cleanup(); leftController.cleanup(); - Controller.disableMapping("com.highfidelity.handControllerGrab"); + Controller.disableMapping(MAPPING_NAME); } Script.scriptEnding.connect(cleanup);