« get me outta code hell

Capture keydown, not keypress - csb-game - Pixelly spin-off of the Command Synergy Battle system used in Final Fantasy XIII
summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-04-22 02:25:42 -0300
committerFlorrie <towerofnix@gmail.com>2019-04-22 02:25:42 -0300
commit079e1c62de3533b53b30428ee67e56b1fac7e636 (patch)
tree9cc139d5532385cea016863f593a3fbc542efbd0
parent58915451bc57839a70a90ef6a908da873de3b852 (diff)
Capture keydown, not keypress HEAD master
This seems more reliable.
-rw-r--r--index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/index.js b/index.js
index 132aaac..b332b23 100644
--- a/index.js
+++ b/index.js
@@ -1670,7 +1670,7 @@ function drawLoop() {
   requestAnimationFrame(drawLoop)
 }
 
-canvas.addEventListener('keypress', evt => {
+canvas.addEventListener('keydown', evt => {
   if (battle.gameState !== 'battle') {
     return
   }