From f148ca5ed3a68bc567bc0ac0fd02658bf24134bb Mon Sep 17 00:00:00 2001 From: Multinite <145994855+Multinite@users.noreply.github.com> Date: Sat, 26 Oct 2024 17:45:00 +1000 Subject: [PATCH] Fix error in sensors/keyboard example code event.code returns ArrowLeft, ArrowUp, etc. Fixed the error in this demo. --- api-documentation/sensors/keyboard.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api-documentation/sensors/keyboard.md b/api-documentation/sensors/keyboard.md index b1c02e4..7da3d5f 100644 --- a/api-documentation/sensors/keyboard.md +++ b/api-documentation/sensors/keyboard.md @@ -58,22 +58,22 @@ function customCoordinatesGetter(event, args) { const delta = 50; switch (event.code) { - case 'Right': + case 'ArrowRight': return { ...currentCoordinates, x: currentCoordinates.x + delta, }; - case 'Left': + case 'ArrowLeft': return { ...currentCoordinates, x: currentCoordinates.x - delta, }; - case 'Down': + case 'ArrowDown': return { ...currentCoordinates, y: currentCoordinates.y + delta, }; - case 'Up': + case 'ArrowUp': return { ...currentCoordinates, y: currentCoordinates.y - delta,