Most appropriate sub-area of p5.js?
p5.js version
2.x (main branch)
Web browser and version
chrome://150
Operating system
Windows 11
Steps to reproduce this
##Description
While testing multi-touch events, I noticed that mouseIsPressed is becoming false even when another finger is still touching the screen.
The expected behavior is that mouseIsPressed should stay true until all active touch points are released. Releasing one finger should not reset it if there are still other active pointers.
##Steps to reproduce
Touch the screen with one finger.
mouseIsPressed becomes true.
Touch the screen with a second finger.
Now there are two active pointers.
Release the second finger while keeping the first finger pressed.
mouseIsPressed becomes false, even though one finger is still touching the screen.
##Expected behavior
mouseIsPressed should only become false when the last active pointer is released.
##Actual behavior
mouseIsPressed becomes false whenever any pointer is released, even if other pointers are still active.
Possible cause
In src/events/pointer.js, the _onpointerup function sets:
this.mouseIsPressed = false;
without checking if there are any remaining active pointers.
The _onpointercancel handler already handles this correctly by checking:
if (this._activePointers.size === 0) {
this.mouseIsPressed = false;
}
The same check should probably be added to _onpointerup as well.
Most appropriate sub-area of p5.js?
p5.js version
2.x (main branch)
Web browser and version
chrome://150
Operating system
Windows 11
Steps to reproduce this
##Description
While testing multi-touch events, I noticed that mouseIsPressed is becoming false even when another finger is still touching the screen.
The expected behavior is that mouseIsPressed should stay true until all active touch points are released. Releasing one finger should not reset it if there are still other active pointers.
##Steps to reproduce
Touch the screen with one finger.
mouseIsPressed becomes true.
Touch the screen with a second finger.
Now there are two active pointers.
Release the second finger while keeping the first finger pressed.
mouseIsPressed becomes false, even though one finger is still touching the screen.
##Expected behavior
mouseIsPressed should only become false when the last active pointer is released.
##Actual behavior
mouseIsPressed becomes false whenever any pointer is released, even if other pointers are still active.
Possible cause
In src/events/pointer.js, the _onpointerup function sets:
this.mouseIsPressed = false;
without checking if there are any remaining active pointers.
The _onpointercancel handler already handles this correctly by checking:
if (this._activePointers.size === 0) {
this.mouseIsPressed = false;
}
The same check should probably be added to _onpointerup as well.