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
2
votes
0 answers
How to do hit detection of mouse in Three.js using PointerLockControls?
I made an open source project. It is a data visualizer for your books in 3D using Three.js. (https://github.com/AlinCiocan/BooksIn3D). And now I want to do detect if a user is in front of a book if pressed a key. Something like this:
For example,…

Alin Ciocan
- 3,082
- 4
- 34
- 47
1
vote
0 answers
Locking the pointer to elements in a vscode extension webview panel throws an error
I am building a vscode extension that creates a webview panel. This panel uses threejs to render a 3d scene - this happens successfully. Unfortunately, no matter what I try, I cannot get the pointer to lock to the canvas with the scene and in the…

anonymous_vegetable
- 11
- 2
1
vote
0 answers
Is there a way to implement pointerlock in a scene exported from blender?
On ThreeJS website, in the example misc_controls_pointerlock, the scene is built with geometries written directly in the code.
Is there a good way to implement this pointerlock in a model of a room that I would have conceived in Blender, for exemple…

rvouilloz
- 11
- 1
1
vote
1 answer
Center pointerlockcontrols on the mouse curosr
The problem
As the cursor locks, the cursor is set to the position of the screen where i clicked. But i would like to have my cursor centered to the screen. As that is not possible for security reasons, the only available option is to move the…

codeanjero
- 674
- 1
- 6
- 14
1
vote
1 answer
Disabling mouse acceleration not supported in Chrome v88
So we use the requestPointerLock() function to lock the mouse pointer of users while gaming on our website. Following the web.dev disable-mouse-acceleration article, I tested their pointer lock API sample and discovered that requesting pointer lock…

Cédric Bloem
- 1,447
- 3
- 16
- 34
1
vote
1 answer
Firefox: allow pointer lock from any context
I need to lock the pointer but when I requestPointerLock it's telling me
Request for pointer lock was denied because Element.requestPointerLock() was not called from inside a short running user-generated event handler, and the document is not in…

php_nub_qq
- 15,199
- 21
- 74
- 144
1
vote
2 answers
mousemove doesn't fire if pointer lock is on
I'm observing strange behaviour when attempting to add a mousemove listener to document after requesting a pointer lock.
I've implemented the following, mostly based on documentation from MDN:
var onLockChange = () => {
…

KernelDeimos
- 503
- 4
- 12
1
vote
0 answers
Preventing Mouse Wheel Event during Pointer Lock in Chrome
I want to prevent the mouse wheel from actually scrolling the document if the pointer is locked to a certain element.
Here is a minimal example: