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
10
votes
0 answers
JavaScript MouseEvent.movementX and movementY large spikes
After a pointer lock with Chrome, if you move the mouse, MouseEvent.movementX and MouseEvent.movementY will sometimes return a very large number that seems to be around half the size of the window.
Here is a minimal code example:
…

CasualKyle
- 433
- 4
- 17
9
votes
2 answers
JS Pointer Lock
I'm having trouble with pointer Locking. My code looks something like this...
Canvas = document.createElement('canvas');
...(Parameters)...
document.body.appendChild(Canvas);
Canvas.requestPointerLock = Canvas.requestPointerLock ||
…

technik3k
- 158
- 1
- 5
7
votes
1 answer
Seems something is wrong when trying to set requestPointerLock()
It seems something is wrong in my code, but I cannot figure what. I am trying to call pointerlockchange api to disable pointer and use mouse as fps controller. The problem is that always pointerlockerror is triggered and I get a Error setting…

kaytrance
- 2,657
- 4
- 30
- 49
3
votes
1 answer
How to activate PointerLockControls only when clicking a button?
I am using the "PointerLockControls" class and I would like to be able to disable the mouse lock when I am in my menu. I want the only way to lock the mouse is to press the button for that.
Similarly to what is done…

Raym
- 51
- 6
3
votes
1 answer
Trying to work with PointerLockControls, WASD keys and Three.js
I hope I'm not asking an obviously noob question, but I noticed on the three.js official examples, PointerLockControls.js allows for mouse pointer lock AND WASD keys navigation.
I've managed to get the mouse pointer to lock, but I am struggling to…

YUNG
- 31
- 2
2
votes
0 answers
Does Android WebView Support for requestPointerLock()?
I am trying to use requestPointerLock from Javascript on Android. I got some errors when trying the most basic things, so I tried out some examples like this or this don't work. At the same time, I read that the API should be supported in Android…

corbin
- 1,446
- 2
- 27
- 40
2
votes
1 answer
How to add in Three.js PointerLockControl?
How to correctly add in Three.js PointerLockControl? I tried using examples, but no luck, always get some kind of error. I import libraries through the head part like that
If I do this…

whothatisShake
- 45
- 1
- 9
2
votes
3 answers
event.movement returning odd values
I have been playing around with webGL and I have reached a point I can make small three dimensional games with very pitiful graphics (it is more of a proof of concept/functionality as of now). For the three dimensional experience, it is nice to move…

Benjamin Brownlee
- 434
- 4
- 16
2
votes
0 answers
three js pointer lock controls rotation isn't centered on my camera location
i have added first person controls to my camera in three js using pointer lock and here is my code that is in the FPControls.js file i have created
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.PointerLockControls = function ( camera ) {
…

Nik Hendricks
- 244
- 2
- 6
- 29
2
votes
2 answers
Do DOM events work with pointer lock?
I have used the pointer lock on my canvas element, and the canvas is on full screen. I want to detect right clicks and left clicks to respond to them. Is it possible to respond to clicks in full screen and pointer lock? I already know how to use the…
user7940785
2
votes
2 answers
Mouse pointer at center of button on hover
I have a set of buttons shown on the screen. I am trying to implement a function which executes upon hovering on a button (having a class 'button').
This function needs to display the mouse pointer at the center of the button, meaning that whilst…

Techs
- 169
- 1
- 1
- 10
2
votes
1 answer
exit pointerlockcontrols three.js not working
I have the following code to lock the cursor (this works fine):
var element = document.body;
var controls;
var instructions = document.getElementById( 'start' );
var havePointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in…

FutureCake
- 2,614
- 3
- 27
- 70
2
votes
1 answer
How to use getDirection() properly with PointerLockControls in Three.js
I'm using PointerLockControls in Three.js.
On mouse click, I want to update a sphere position to the position the camera is facing, at the same z-position of a certain object. I've read about getDirection(), but can't seem to implement it the right…

binoculars
- 2,226
- 5
- 33
- 61
2
votes
0 answers
How can I properly detect mousemove deltas beyond the screen in XUL?
For the SlyZoom extension I have created, I want to implement a virtual slider: a XUL/XBL element that acts as a small static region where, on mousedown, the mouse pointer changes to ew-resize and I capture mousemove events to detect horizontal…

Codifier
- 354
- 1
- 14
2
votes
1 answer
PointerLock with dart
Is there a way to lock the cursor with dart that works on Firefox and Chrome?
I tried:
void lock(event)
{
var canvas = document.querySelector('canvas');
canvas.requestPointerLock();
}
in a mousedown-event listener
…

pasiS
- 41
- 5