File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -832,10 +832,16 @@ function keyboard(p5, fn){
832
832
* }
833
833
* ```
834
834
*
835
- * `keyIsDown()` can check for key presses using
836
- * <a href="#/p5/keyCode">keyCode</a> values, as in `keyIsDown(37)` or
837
- * `keyIsDown(LEFT_ARROW)`. Key codes can be found on websites such as
838
- * <a href="https://keycode.info" target="_blank">keycode.info</a>.
835
+ * `keyIsDown()` can check for key presses using strings based on
836
+ * <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key" target="_blank">KeyboardEvent.key</a>
837
+ * or <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code" target="_blank">KeyboardEvent.code</a> values,
838
+ * such as `keyIsDown('x')` or `keyIsDown('ArrowLeft')`.
839
+ *
840
+ * Note: In p5.js 2.0 and newer, numeric keycodes (such as 88 for 'X') are no longer supported.
841
+ * This is a breaking change from previous versions.
842
+ *
843
+ * You can still use the p5 constants like `LEFT_ARROW` which now map to string values
844
+ * internally rather than numeric codes.
839
845
*
840
846
* @method keyIsDown
841
847
* @param {Number|String } code key to check.
You can’t perform that action at this time.
0 commit comments