Skip to content

Commit

Permalink
Added hotkeys for internet explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
GDur committed Nov 25, 2018
1 parent 1adf1c3 commit 4097695
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ const keyHandler = (e: KeyboardEvent) => {
player1.keyDown = (e.type == "keydown");
}

if (e.key == 'ArrowRight') {
if (e.key == 'ArrowRight' || e.key == 'Right') {
e.preventDefault()
player2.keyRight = (e.type == "keydown");
} else if (e.key == 'ArrowLeft') {
} else if (e.key == 'ArrowLeft' || e.key == 'Left') {
e.preventDefault()
player2.keyLeft = (e.type == "keydown");
}
if (e.key == 'ArrowUp') {
if (e.key == 'ArrowUp' || e.key == 'Up') {
e.preventDefault()
player2.keyUp = (e.type == "keydown");
} else if (e.key == 'ArrowDown') {
} else if (e.key == 'ArrowDown' || e.key == 'Down') {
e.preventDefault()
player2.keyDown = (e.type == "keydown");
}
Expand Down

0 comments on commit 4097695

Please sign in to comment.