diff --git a/src/components/input-configurator.js b/src/components/input-configurator.js index 1ea4796fb3e1eee775d69689723aa218ac94f3ea..4e7c2cfac7445f4a8c8fbdca6afc5a961d912185 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 8f500eacd51f839d46d10b21ca6136b53a017ae9..bd2ed13a1bd9a66f4d3b86312c97e76377e857a1 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 54856666c451cd5506bd11a2da2e28e0646b6708..9c6b71af828e2e09300db7decf5f9e3d9de0f4bc 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(); } }