derektmueller / purescript-p5

p5.js bindings for PureScript
MIT License
19 stars 4 forks source link

`keyPressed` should be implemented like `setup` or `draw` #7

Closed dotKuro closed 5 years ago

dotKuro commented 5 years ago

keyPressed in P5 is a function name that should be implemented by the user like setup or draw. Confused by the type signature I found on pursuit, I started browsing this source code and it seems like keyPressed (and similiar functions like keyReleased) are implemented like ordinary callable functions like background or rect.

Since these bindings are still under heavy development I don't know if this is a bug or just not finished yet. If there is interest in that, I will contribute a fix for a bug.

derektmueller commented 5 years ago

Good catch. It looks like all of the functions in the Events module have incorrect type signatures. Most of the functions in this library were auto-generated from the p5.js javadoc, and these were generated incorrectly. I'll put in a fix for this.

derektmueller commented 5 years ago

Fixed in v0.11.0