Skip to content

Commit

Permalink
Add arrow key controls to camera-controls.mjs (#7270)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentwoo authored Jan 13, 2025
1 parent aae9c5b commit 9cd5341
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/esm/camera-controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -604,15 +604,19 @@ class CameraControls extends Script {
event.stopPropagation();
switch (event.key.toLowerCase()) {
case 'w':
case 'arrowup':
this._key.forward = true;
break;
case 's':
case 'arrowdown':
this._key.backward = true;
break;
case 'a':
case 'arrowleft':
this._key.left = true;
break;
case 'd':
case 'arrowright':
this._key.right = true;
break;
case 'q':
Expand All @@ -638,15 +642,19 @@ class CameraControls extends Script {
event.stopPropagation();
switch (event.key.toLowerCase()) {
case 'w':
case 'arrowup':
this._key.forward = false;
break;
case 's':
case 'arrowdown':
this._key.backward = false;
break;
case 'a':
case 'arrowleft':
this._key.left = false;
break;
case 'd':
case 'arrowright':
this._key.right = false;
break;
case 'q':
Expand Down

0 comments on commit 9cd5341

Please sign in to comment.