# How to just lock the mouse?

**URL:** <https://discourse.threejs.org/t/how-to-just-lock-the-mouse/30420>\
**Category:** Questions\
**Tags:** pointerlockcontrols\
**Created:** [October 1, 2021, 3:02am UTC](https://discourse.threejs.org/t/how-to-just-lock-the-mouse/30420 "2021-10-01T03:02:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Howardman](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/howardman/32/14696_2.png) [@Howardman](https://discourse.threejs.org/u/Howardman)\
**Post date:** [October 1, 2021, 3:02am UTC](https://discourse.threejs.org/t/how-to-just-lock-the-mouse/30420/1 "2021-10-01T03:02:42Z")

</div>

In the example for mouse pointer lock, it uses controls as well, which confuses me. I want the lock only, not the movement. code: `

 Cave Game const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); const renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement);

```
  const texture = new THREE.TextureLoader().load("grass.jpg");
  const geometry = new THREE.BoxGeometry();
  const material = new THREE.MeshBasicMaterial({ map: texture });
  const cube = new THREE.Mesh(geometry, material);
  scene.add(cube);

  camera.position.z = 5;
  camera.position.y = 2;

  const animate = function () {
    requestAnimationFrame(animate);

    renderer.render(scene, camera);
  };
  animate();
</script>

```

 `

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [October 1, 2021, 3:53am UTC](https://discourse.threejs.org/t/how-to-just-lock-the-mouse/30420/2 "2021-10-01T03:53:01Z")

</div>

You don’t really need three or any controls to do that - there’s a [Pointer Lock API](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API) built into the browser.
