Pointer lock provides input methods based on the movement of the mouse over time, not just the absolute position of the mouse cursor.
Questions tagged [pointerlock]
61 questions
0
votes
1 answer
Difficulty incorporating pointer lock controls API in three.js using es6 classes that are not modules
As the title states, I am using es6 classes, but because they are all not modules apart from the main.js file, it makes it difficult to use API's because I cannot make use of import modules.
I used the code from this link's answer: How to add in…

Harushii
- 7
- 1
- 5
0
votes
0 answers
Pointer Lock does Not Work on Android Browsers (official demo)
This is the online demo suggested by MDN:
https://mdn.github.io/dom-examples/pointer-lock/
It works on desktop, but not on mobile (Chrome, Edge, FF).
Meanwhile, the pointer lock API is listed as widely supported on…

dllb
- 59
- 1
- 7
0
votes
1 answer
Is there a way to limit the angle of rotation of the camera with PointerLock controls in THREE.JS?
I was wondering if there is a way to limit the polar angle so the camera doesn't go into the ground when I'm using PointerLock controls in Three.js? Similar to the minPolarAngle and maxPolarAngle for Orbit controls?

Prav
- 610
- 8
- 20
0
votes
1 answer
How to stop camera movement after esc and direction keys is pressed in three.js?
I am using Pointer Lock Controls for my project and found a bug. If player is pressing any of directions keys on keyboard and in the same time he presses esc button (to turn of Pointer Lock Controls), camera is still moving in a background, although…

whothatisShake
- 45
- 1
- 9
0
votes
1 answer
How to get mouseMovement when cursor is locked?
While looking for way to lock the cursor in processing/p5.js/javascript I realized that even once I figured that out I would not be able to detect mouse movement. How do people do it in typical fps games?

Coding King2
- 37
- 1
- 11
0
votes
1 answer
Disable escape option while using PointerLockControls
I would like to know if it is possible to disable the ESCAPE option (using PointerLockControls and ThreeJS) when pressing escape on your keyboard.
I want to use this key for another purpose in my project!
Thanks in advance for any help!

fjavier10
- 31
- 5
0
votes
2 answers
The camera rotates in a wrong way when its position is not (0,0,0) with PointerLockControls
three.js r91
I changed the PointerLockControls example a little on line 173:
camera.position.set(100, 0, 0);
controls = new THREE.PointerLockControls( camera );
controls.getObject().position.set(100, 0, 0);
scene.add( controls.getObject() );
When I…

zwcloud
- 4,546
- 3
- 40
- 69
0
votes
1 answer
Activate pointerLock in a Jupyter notebook
I'm currently trying to use the Pointer Lock API into a Jupyter notebook. Basically I want to log a bunch of trackpad moves without being limited by the dimensions of the screen, then pass it on to Python to do some calculations on it. In what…

Mathiev
- 1
- 1
0
votes
1 answer
requestPointerLock() not working inside of Vue.js component
I am trying to use requestPointerLock() inside of a Vue.js component. If the pointerShouldLock data item of my component is true, the pointer should get locked during the beforeUpdate() lifecycle hook. My code looks like this:
beforeUpdate() {
…

lsgng
- 465
- 8
- 22
0
votes
1 answer
Identify mouse events during requestPointerLock
Is there any way to identify right click event ("contextmenu") & scroll events while pointer lock API is enabled? I am trying to create a browser-based 3d game in which the player will be able to perform different activities by left clicking, right…

Debojyoti Ghosh
- 375
- 1
- 2
- 17
0
votes
1 answer
A-Frame cursor clicking disabled after implementing Pointer Lock
I'm using A-Frame on my project. There's this cursor component that enables you to interact with the elements by clicking, which is quite similar to DOM clicking.
However, the cursor clicking no longer works after I implemented my Pointer…

Qin_Shihuang
- 13
- 2
0
votes
1 answer
Change look speed when using PointerLockControls
I'm trying out pointer lock in three.js via the examples, but I can't find much information on it.
I'd like to show the user a text field in which they can manually enter their look speed (so the speed of the mouse).
Anyone knows how to do this?…

binoculars
- 2,226
- 5
- 33
- 61
0
votes
2 answers
Three.js Pointerlockcontrols shooting along y-axis
Currently I am developing a FPS with three.js and pointerlockcontrols.
Using the code below I can shoot into any horizontal direction:
var direction = new THREE.Vector3( 0, 0, -1 );
var rotation = new THREE.Euler( 0, 0, 0, "XYZ" );
var…

Maarten Hartman
- 1,611
- 6
- 26
- 45
0
votes
2 answers
First-person shooter on Android – how to process mouse events?
As a hobby and to learn, whether this is possible, I'm trying to implement a simple first-person shooter for Android. Unfortunately, I ran into a dead end when dealing with mouse event processing.
I already have an onGenericMotion()-Listener, which…

Daniel Eberts
- 141
- 6
0
votes
1 answer
Pointerlock without fullscreen API
How is it possible, to use pointerlock without fullscreen mode?
The tutorials on the web uses the fullscreen api too: https://developer.mozilla.org/en-US/docs/WebAPI/Pointer_Lock

don kaka
- 1,179
- 2
- 12
- 28