p5js/hydra mouse and key events do not work in the editor
I had this problem when working on #318. The mouse/keyboard events weren't being triggered.
The events are only sent when I'm outside the editor, but the only parts of the site outside the editor are, a small space at the top of the page between the button to change the target and the settings button and some parts of the edge of the site
p5 = new P5()
p5.draw = () => {
p5.fill(p5.mouseX/5, p5.mouseY/5, 255, 100)
p5.rect(p5.mouseX, p5.mouseY, 30, 150)
}
s0.init({src: p5.canvas})
src(s0).out()
shape()
.scrollX(() => mouse.y / 1080, 0)
.rotate(() => mouse.x / 1920, 0)
.out()
I've seen that events work with the editor hidden. That makes sense.
As the editor can be hidden with ctrl-shift-h, perhaps this is not a bug, but a desired behavior, when the editor is active the main function should be to edit.
I think documenting this behavior is enough
Hi! I don't think it was a desired behavior, in fact, I'm quite surprised it's behaving like that, AFAIK there's nothing telling it to explicitly allow or disallow pointer events when hiding the editor, it only changes the opacity of the div 🤔