processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.11k stars 3.22k forks source link

Expand keyIsDown() to work with characters as arguments #6993

Open wwwld1 opened 2 months ago

wwwld1 commented 2 months ago

Resolves #6798

Changes:

This is a working draft of this issue #6798 which allows for keyIsDown() to accept alphanumeric String params such as 'w' or 'W'. Regarding the confusing case of the int 4 versus string '4', this implementation includes both where the string parameter e.g. '4' reflects the ASCII value of '4' while the int parameter e.g. 4 reflects the ASCII code 4.

The documentation is also updated to reflect the changes with examples now included for the new changes.

Screenshots of the change:

image

PR Checklist