From 8c7c436ef20ac48aa28b8afc40d393b18125c6de Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Tue, 5 Jan 2016 16:54:18 -0800 Subject: [PATCH] fix --- examples/grab.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/grab.js b/examples/grab.js index 1637e1bcf2..cb0723b8eb 100644 --- a/examples/grab.js +++ b/examples/grab.js @@ -309,7 +309,7 @@ Grabber.prototype.computeNewGrabPlane = function() { } Grabber.prototype.pressEvent = function(event) { - if (!event.isLeftButton) { + if (event.isLeftButton!==true ||event.isRightButton===true || event.isMiddleButton===true) { return; } @@ -374,7 +374,11 @@ Grabber.prototype.pressEvent = function(event) { //Audio.playSound(grabSound, { position: entityProperties.position, volume: VOLUME }); } -Grabber.prototype.releaseEvent = function() { +Grabber.prototype.releaseEvent = function(event) { + if (event.isLeftButton!==true ||event.isRightButton===true || event.isMiddleButton===true) { + return; + } + if (this.isGrabbing) { this.deactivateEntity(this.entityID); this.isGrabbing = false