Skip to content

Commit

Permalink
Use W,A,S,D for navigation in addition to arrow keys
Browse files Browse the repository at this point in the history
  • Loading branch information
quaertym authored Aug 9, 2016
1 parent 0da03a0 commit 4f056c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/views/map/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ const handleMove = action((direction) => {

window.addEventListener('keydown', ({ keyCode }) => {
switch (keyCode) {
case 65:
case 37: { return handleMove('LEFT') }
case 87:
case 38: { return handleMove('UP') }
case 68:
case 39: { return handleMove('RIGHT') }
case 83:
case 40: { return handleMove('DOWN') }
default: return undefined
}
Expand Down

0 comments on commit 4f056c3

Please sign in to comment.