-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Labels
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- p5.strands
- WebGL
- DevOps, Build process, Unit testing
- Internationalization (i18n)
- Friendly Errors
- Other (specify if possible)
p5.js version
1.11.7
Web browser and version
No response
Operating system
No response
Steps to reproduce this
Steps (see snippet):
- Write a program that calls
requestPointerLock()
onmouseClicked
- Use
movedX
andmovedY
values, for example by displaying them on screen
Expectation:
When I move the mouse, it shows by how much the mouse moved that frame. After I click the mouse which calls requestPointerLock
, the movedX
and movedY
will continue showing by how much the mouse moved, even if the mouse is now invisible and locked, as per the documentation on https://p5js.org/reference/p5/movedX/:
Note: movedX continues updating even when requestPointerLock() is active.
Reality:
When using p5 version 1.11.7 or onwards, after calling requestPointerLock
, movedX
and movedY
now no longer update and stay at 0 even when moving my mouse around.
On p5 version 1.11.6 or below, it behaves as expected.
Although I haven't tested it, I suspect that Commit fbffbc1
: Consistent movedX and movedY behaviour across zoom levels
is the culprit.
Snippet:
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
text(movedX, 20, 20);
text(movedY, 20, 40);
}
function mouseClicked() {
requestPointerLock();
}
ksen0