src/components/look-controls.js
function () {
    var sceneEl = this.el.sceneEl;
    var canvasEl = sceneEl && sceneEl.canvas;

    if (!canvasEl) { return; }

    // Mouse events.
    canvasEl.removeEventListener('mousedown', this.onMouseDown);
    window.removeEventListener('mousemove', this.onMouseMove);
    window.removeEventListener('mouseup', this.onMouseUp);

    // Touch events.
    canvasEl.removeEventListener('touchstart', this.onTouchStart);
    window.removeEventListener('touchmove', this.onTouchMove);
    window.removeEventListener('touchend', this.onTouchEnd);

    // sceneEl events.
    sceneEl.removeEventListener('enter-vr', this.onEnterVR);
    sceneEl.removeEventListener('exit-vr', this.onExitVR);

    // Pointer Lock events.
    document.removeEventListener('pointerlockchange', this.onPointerLockChange, false);
    document.removeEventListener('mozpointerlockchange', this.onPointerLockChange, false);
    document.removeEventListener('pointerlockerror', this.onPointerLockError, false);
  }
function () {
    var sceneEl = this.el.sceneEl;
    var canvasEl = sceneEl && sceneEl.canvas;

    if (!canvasEl) { return; }

    // Mouse events.
    canvasEl.removeEventListener('mousedown', this.onMouseDown);
    window.removeEventListener('mousemove', this.onMouseMove);
    window.removeEventListener('mouseup', this.onMouseUp);

    // Touch events.
    canvasEl.removeEventListener('touchstart', this.onTouchStart);
    window.removeEventListener('touchmove', this.onTouchMove);
    window.removeEventListener('touchend', this.onTouchEnd);

    // sceneEl events.
    sceneEl.removeEventListener('enter-vr', this.onEnterVR);
    sceneEl.removeEventListener('exit-vr', this.onExitVR);

    // Pointer Lock events.
    document.removeEventListener('pointerlockchange', this.onPointerLockChange, false);
    document.removeEventListener('mozpointerlockchange', this.onPointerLockChange, false);
    document.removeEventListener('pointerlockerror', this.onPointerLockError, false);
  }
function ( ) { var sceneEl = this . el . sceneEl ; var canvasEl = sceneEl && sceneEl . canvas ; if ( ! canvasEl ) { return ; } // Mouse events. canvasEl . removeEventListener ( 'mousedown' , this . onMouseDown ) ; window . removeEventListener ( 'mousemove' , this . onMouseMove ) ; window . removeEventListener ( 'mouseup' , this . onMouseUp ) ; // Touch events. canvasEl . removeEventListener ( 'touchstart' , this . onTouchStart ) ; window . removeEventListener ( 'touchmove' , this . onTouchMove ) ; window . removeEventListener ( 'touchend' , this . onTouchEnd ) ; // sceneEl events. sceneEl . removeEventListener ( 'enter-vr' , this . onEnterVR ) ; sceneEl . removeEventListener ( 'exit-vr' , this . onExitVR ) ; // Pointer Lock events. document . removeEventListener ( 'pointerlockchange' , this . onPointerLockChange , false ) ; document . removeEventListener ( 'mozpointerlockchange' , this . onPointerLockChange , false ) ; document . removeEventListener ( 'pointerlockerror' , this . onPointerLockError , false ) ; }
Remove mouse and touch event listeners from canvas.
Remove mouse and touch event listeners from canvas .