From 66e6333cb45f79c2e9e2e74e89eea7086f6773d9 Mon Sep 17 00:00:00 2001 From: Elijah Cohen Date: Fri, 17 May 2019 22:02:26 -0500 Subject: [PATCH] same input bug --- web/input.js | 4 ++-- web/main.js | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/web/input.js b/web/input.js index 7b943f6..e7897a2 100644 --- a/web/input.js +++ b/web/input.js @@ -24,6 +24,7 @@ function keypressHandler(evt, isdn) { keystate = thekey; input = thekey; } + keySender(keystate); } var upKey = function(kc) { @@ -51,13 +52,12 @@ function touchHandler(evt, isdn) { keystate = 'd'; input = 'd'; } - + keySender(keystate); } function keySender(ws) { - if(keystate != 'x') ws.send(keystate); } diff --git a/web/main.js b/web/main.js index 650146f..8acbf5c 100644 --- a/web/main.js +++ b/web/main.js @@ -94,9 +94,6 @@ var main = function() { // starts everything, gets us going, setup ish document.onkeyup = function(e) {keypressHandler(e, false);}; canvas.addEventListener('touchstart', function(e) {touchHandler(e, true);}); canvas.addEventListener('touchend', function(e) {touchHandler(e, false);}); - var interval = setInterval(function(){keySender(theSocket);}, c.MS_PER_FRAME); - - theSocket.onclose = function(e) {clearInterval(interval)}; } window.addEventListener("DOMContentLoaded", e => main()); -- 2.39.2