From 7d4d4f25f27110caec7451769f5e9796d5797f24 Mon Sep 17 00:00:00 2001 From: joni <johnfshaughnessy@gmail.com> Date: Mon, 4 Jun 2018 11:16:10 -0700 Subject: [PATCH] Minor adjustments for PR feedback. --- src/components/input-configurator.js | 2 ++ src/utils/action-event-handler.js | 4 +--- src/utils/mouse-events-handler.js | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/input-configurator.js b/src/components/input-configurator.js index 1ea4796fb..4e7c2cfac 100644 --- a/src/components/input-configurator.js +++ b/src/components/input-configurator.js @@ -86,6 +86,7 @@ AFRAME.registerComponent("input-configurator", { this.hovered = false; this.actionEventHandler = new ActionEventHandler(this.el.sceneEl, this.cursor); this.eventHandlers.push(this.actionEventHandler); + this.cursor.el.setAttribute("cursor-controller", "minDistance", 0); if (this.isMobile) { this.eventHandlers.push(new GearVRMouseEventsHandler(this.cursor, this.gazeTeleporter)); } else { @@ -99,6 +100,7 @@ AFRAME.registerComponent("input-configurator", { this.addLookOnMobile(); } else { this.eventHandlers.push(new MouseEventsHandler(this.cursor, this.cameraController)); + this.cursor.el.setAttribute("cursor-controller", "minDistance", 0.3); } } }, diff --git a/src/utils/action-event-handler.js b/src/utils/action-event-handler.js index 8f500eacd..bd2ed13a1 100644 --- a/src/utils/action-event-handler.js +++ b/src/utils/action-event-handler.js @@ -39,9 +39,7 @@ export default class ActionEventHandler { } onMoveDuck(e) { - if (this.isCursorInteracting) { - this.cursor.changeDistanceMod(-e.detail.axis[1] / 8); - } + this.cursor.changeDistanceMod(-e.detail.axis[1] / 8); } setCursorController(cursorController) { diff --git a/src/utils/mouse-events-handler.js b/src/utils/mouse-events-handler.js index 54856666c..9c6b71af8 100644 --- a/src/utils/mouse-events-handler.js +++ b/src/utils/mouse-events-handler.js @@ -49,9 +49,10 @@ export default class MouseEventsHandler { onMouseDown(e) { const isLeftButton = e.button === 0; + const isRightButton = e.button === 2; if (isLeftButton) { this.onLeftButtonDown(); - } else { + } else if (isRightButton) { this.onRightButtonDown(); } } -- GitLab