repo: janusweb
action: commit
revision: 
path_from: 
revision_from: efadb9940012bc339aa99cd7e51c73222726abf6:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit efadb9940012bc339aa99cd7e51c73222726abf6
Author: James Baicoianu 
Date:   Wed Sep 11 13:33:37 2024 -0700

    Disable touchscreen controls if room.pointerlock is false

diff --git a/scripts/janusplayer.js b/scripts/janusplayer.js
index b91cdeb20564f5188b51e0076a23c8582239e1ed..
index ..c655c48f2745b283093403c5a16891fa0261d272 100644
--- a/scripts/janusplayer.js
+++ b/scripts/janusplayer.js
@@ -1004,6 +1004,7 @@ document.body.dispatchEvent(click);
     }
     this.handleTouchStart = function(ev) {
       //if (!this.enabled) return;
+      if (!room.pointerlock) return;
       let halfscreenwidth = window.innerWidth / 2;
       this.enabled = true;
       for (let i = 0; i < ev.changedTouches.length; i++) {
@@ -1021,6 +1022,7 @@ document.body.dispatchEvent(click);
       this.cancelTouchMovement(ev);
     }
     this.handleTouchMove = function(ev) {
+      if (!room.pointerlock) return;
       if (ev.defaultPrevented) return;
       //if (ev.touches.length == 1) {
         //var touchindex = this.touchindex;

-----END OF PAGE-----