From 712048ce51de5233cd484214e52d10a8b11a0a8f Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Tue, 24 Nov 2015 19:35:10 +0100 Subject: [PATCH 1/2] ignore other than left press events in edit.js, this makes the rightclick camera more confortable while in edit.js/edit mode --- examples/edit.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/edit.js b/examples/edit.js index 74551384c9..9b83079198 100644 --- a/examples/edit.js +++ b/examples/edit.js @@ -738,6 +738,10 @@ var mousePressStartPosition = { var mouseDown = false; function mousePressEvent(event) { + if (!event.isLeftButton) { + // If another mouse button than left is pressed ignore it + return false; + } mouseDown = true; mousePressStartPosition = { x: event.x, From 22bdc1ae840c56fc4adb0762376a3ef1654fbf42 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Mon, 7 Dec 2015 13:49:49 +0100 Subject: [PATCH 2/2] Make it possible to use the focus-right-click-drag-camera in the edit.js script again. Still keep right-clicking ignore Toolbar and entity selection events. --- examples/edit.js | 9 +++++---- examples/libraries/entitySelectionTool.js | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/edit.js b/examples/edit.js index 9b83079198..5d5d642f47 100644 --- a/examples/edit.js +++ b/examples/edit.js @@ -392,6 +392,11 @@ var toolBar = (function() { url, file; + if (!event.isLeftButton) { + // if another mouse button than left is pressed ignore it + return false; + } + clickedOverlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y @@ -738,10 +743,6 @@ var mousePressStartPosition = { var mouseDown = false; function mousePressEvent(event) { - if (!event.isLeftButton) { - // If another mouse button than left is pressed ignore it - return false; - } mouseDown = true; mousePressStartPosition = { x: event.x, diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index 61aa5b0394..6edbe6844b 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -2340,6 +2340,11 @@ SelectionDisplay = (function () { that.mousePressEvent = function(event) { + if (!event.isLeftButton) { + // if another mouse button than left is pressed ignore it + return false; + } + var somethingClicked = false; var pickRay = Camera.computePickRay(event.x, event.y);