Most appropriate sub-area of p5.js?
p5.js version
No response
Web browser and version
No response
Operating system
No response
Steps to reproduce this
Hold a mouse button on the canvas, alt-tab away, release the button, come back. mouseIsPressed is still true.
keyboard.js at least has _onblur (incomplete, see #8540). mouse.js has nothing, no blur handler at all. So mouseIsPressed and mouseButton just stay frozen at whatever they were when the window lost focus.
function draw() {
background(220);
text('mouseIsPressed: ' + mouseIsPressed, 20, 50);
}
Steps: hold mouse on canvas → alt-tab → release → come back → still shows true
Fix would be the same pattern as the keyboard blur fix, add an _onblur to mouse.js that resets mouseIsPressed = false.