Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p5js/hydra mouse and key events do not work in the editor #321

Open
taconi opened this issue Jan 5, 2025 · 2 comments · May be fixed by #331
Open

p5js/hydra mouse and key events do not work in the editor #321

taconi opened this issue Jan 5, 2025 · 2 comments · May be fixed by #331
Labels
bug Something isn't working hydra Related to Hydra

Comments

@taconi
Copy link
Contributor

taconi commented Jan 5, 2025

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

Peek 04-01-2025 22-19

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()

Peek 04-01-2025 22-28

shape()
  .scrollX(() => mouse.y / 1080, 0)
  .rotate(() => mouse.x / 1920, 0)
  .out()
@munshkr munshkr added bug Something isn't working hydra Related to Hydra labels Jan 5, 2025
@taconi
Copy link
Contributor Author

taconi commented Jan 20, 2025

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

@taconi taconi linked a pull request Jan 20, 2025 that will close this issue
@munshkr
Copy link
Owner

munshkr commented Jan 26, 2025

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 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hydra Related to Hydra
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants