From e7277af238e8175ba72e93c8db33407fe33b7bfb Mon Sep 17 00:00:00 2001 From: Armored-Dragon Date: Thu, 14 Sep 2023 15:27:55 -0500 Subject: [PATCH 1/3] inspect.js and mouselook.js compatibility --- scripts/system/controllers/mouseLook.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/system/controllers/mouseLook.js b/scripts/system/controllers/mouseLook.js index f62a802a709..7b867bb336d 100644 --- a/scripts/system/controllers/mouseLook.js +++ b/scripts/system/controllers/mouseLook.js @@ -18,6 +18,8 @@ by rampa3 (https://github.com/rampa3) and vegaslon (https://github.com/vegaslon) var tempOff = false; + var altMode = false; + Camera.mouseLookChanged.connect(onMouseLookChanged); function onMouseLookChanged(newMouseLook) { @@ -41,6 +43,21 @@ by rampa3 (https://github.com/rampa3) and vegaslon (https://github.com/vegaslon) function onKeyPressEvent(event) { if (!hmd){ + if(event.isAlt){ + if (keysOnOverlay) return; + if (!mouseLookEnabled) return; + mouseLookOff(); + Window.displayAnnouncement("Mouse look: Temporarily OFF"); + tempOff = true; + altMode = true; + } + if (tempOff && altMode && ['left', 'right', 'up', 'down', 'esc', 'w', 'a', 's', 'd'].includes(event.text.toLowerCase())){ + if (keysOnOverlay) return; + if (!mouseLookEnabled) return; + mouseLookOn(); + tempOff = false; + altMode = false + } if (event.text === 'm') { if (!keysOnOverlay) { if (mouseLookEnabled) { From 1d1305a6689804beef8db9025bf6764f640066d6 Mon Sep 17 00:00:00 2001 From: Armored-Dragon Date: Fri, 15 Sep 2023 14:40:50 -0500 Subject: [PATCH 2/3] Fix away-enabled causing unsynchronised behavior --- scripts/system/controllers/mouseLook.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/system/controllers/mouseLook.js b/scripts/system/controllers/mouseLook.js index 7b867bb336d..6d1b2d4367c 100644 --- a/scripts/system/controllers/mouseLook.js +++ b/scripts/system/controllers/mouseLook.js @@ -191,6 +191,12 @@ by rampa3 (https://github.com/rampa3) and vegaslon (https://github.com/vegaslon) } } + Messages.messageReceived.connect(onMessageReceived); + function onMessageReceived(channel, message, sender, localOnly) { + if (channel === "Hifi-Away-Enable") + if (message === 'enable') mouseLookOn(); + } + Script.scriptEnding.connect(onScriptEnding); function onScriptEnding() { From 391052d9c13195fb82b8078b85aaedeca92ddfe8 Mon Sep 17 00:00:00 2001 From: Armored-Dragon Date: Sat, 16 Sep 2023 07:23:58 -0500 Subject: [PATCH 3/3] Fixed conflict. --- scripts/system/controllers/mouseLook.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/controllers/mouseLook.js b/scripts/system/controllers/mouseLook.js index 6d1b2d4367c..31a8499b0f1 100644 --- a/scripts/system/controllers/mouseLook.js +++ b/scripts/system/controllers/mouseLook.js @@ -58,7 +58,7 @@ by rampa3 (https://github.com/rampa3) and vegaslon (https://github.com/vegaslon) tempOff = false; altMode = false } - if (event.text === 'm') { + if (event.text.toLowerCase() === 'm') { if (!keysOnOverlay) { if (mouseLookEnabled) { if (!Camera.getCaptureMouse()){