Skip to content

Commit be02c79

Browse files
authored
Adding table
1 parent e8cd05c commit be02c79

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

src/events/keyboard.js

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ function keyboard(p5, fn){
224224
* if (code === 'ArrowRight') {
225225
* // …
226226
* }
227-
* ```
228227
* if (key === 'ArrowRight') {
229228
* // …
230229
* }
@@ -241,8 +240,41 @@ function keyboard(p5, fn){
241240
* }
242241
* ```
243242
*
244-
*
245-
*
243+
*
244+
* <p>The table below summarizes how the main keyboard-related system variables changed between p5.js 1.x and 2.x.</p>
245+
* <table>
246+
* <thead>
247+
* <tr>
248+
* <th>Variable</th>
249+
* <th>p5.js 1.x </th>
250+
* <th>p5.js 2.x </th>
251+
* </tr>
252+
* </thead>
253+
* <tbody>
254+
* <tr>
255+
* <td><code>key</code></td>
256+
* <td>Text string (e.g., <code>"ArrowUp"</code>).</td>
257+
* <td>Text string (e.g., <code>"ArrowUp"</code>, <code>"f"</code> or <code>"F"</code>).</td>
258+
* </tr>
259+
* <tr>
260+
* <td><code>code</code></td>
261+
* <td><em>Not supported.</em></td>
262+
* <td>Text String (e.g., <code>"ArrowUp"</code>, <code>"KeyF"</code>).</td>
263+
* </tr>
264+
* <tr>
265+
* <td><code>keyCode</code></td>
266+
* <td>Number (e.g., <code>70</code>).</td>
267+
* <td>Number (unchanged; e.g., <code>70</code>).</td>
268+
* </tr>
269+
* <tr>
270+
* <td>System variables (<code>BACKSPACE</code>, <code>UP_ARROW</code>, …)</td>
271+
* <td>Number</td>
272+
* <td>Text String (e.g., <code>"ArrowUp"</code>).</td>
273+
* </tr>
274+
* </tbody>
275+
* </table>
276+
*
277+
*
246278
* @property {String} code
247279
* @readOnly
248280
*

0 commit comments

Comments
 (0)