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

feat: enable visualizers to use p5's keyPressed #259

Closed
liammulh opened this issue Mar 22, 2023 · 1 comment
Closed

feat: enable visualizers to use p5's keyPressed #259

liammulh opened this issue Mar 22, 2023 · 1 comment

Comments

@liammulh
Copy link
Member

In #120, @katestange was wanting to enable visualizers to use keyPressed.

p5 allows a user to define a keyPressed function. From the docs:

The keyPressed() function is called once every time a key is pressed.

The developer never calls the keyPressed function. Seemingly p5 does that. I imagine p5 looks at your source code, finds the keyPressed function you defined, and then uses it as a callback for a key down event listener. See this example.

I have no idea how to define the keyPressed function in a visualizer class so that it is called by p5.

@gwhitney
Copy link
Collaborator

This was enabled in #277. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants