From 335b9aae7b4bfec1139869c33ebdd526f695f426 Mon Sep 17 00:00:00 2001 From: John Shaughnessy Date: Thu, 14 Oct 2021 12:02:17 -0700 Subject: [PATCH] Allow touchscreen to push buttons when move media perms are disabled --- src/systems/userinput/devices/app-aware-touchscreen.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/systems/userinput/devices/app-aware-touchscreen.js b/src/systems/userinput/devices/app-aware-touchscreen.js index 33fbef4767..491aa3c336 100644 --- a/src/systems/userinput/devices/app-aware-touchscreen.js +++ b/src/systems/userinput/devices/app-aware-touchscreen.js @@ -36,6 +36,10 @@ const getPlayerCamera = (() => { }; })(); +function isSingleActionButton(el) { + return el.components.tags && el.components.tags.data.singleActionButton; +} + function shouldMoveCursor(touch, rect, raycaster) { const isCursorGrabbing = !!AFRAME.scenes[0].systems.interaction.state.rightRemote.held; if (isCursorGrabbing) { @@ -74,7 +78,7 @@ function shouldMoveCursor(touch, rect, raycaster) { (isFrozen || !isPinned) && !isStaticControlledMedia && !isStaticMedia && - (remoteHoverTarget && canMove(remoteHoverTarget)) + (remoteHoverTarget && (canMove(remoteHoverTarget) || isSingleActionButton(remoteHoverTarget))) ); }