From 3597285a995dda23980cbd3c627f2d86a70f571a Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Sun, 17 Mar 2024 18:48:09 +0530 Subject: update --- projects/chip8emu/module.js | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'projects/chip8emu/module.js') diff --git a/projects/chip8emu/module.js b/projects/chip8emu/module.js index 711736e..851257a 100644 --- a/projects/chip8emu/module.js +++ b/projects/chip8emu/module.js @@ -48,14 +48,10 @@ var Module = { monitorRunDependencies: (left) => { this.totalDependencies = Math.max(this.totalDependencies, left); Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.'); - }, - simulateKeyPressE: function() { - var canvas = document.getElementById('canvas'); - canvas.focus(); - - canvas.dispatchEvent(new KeyboardEvent('keydown', { 'key': 'e', 'code': 'KeyE', 'keyCode': 82 })); } }; + + Module.setStatus('Downloading...'); window.onerror = () => { Module.setStatus('Exception thrown, see JavaScript console'); @@ -63,23 +59,3 @@ window.onerror = () => { if (text) console.error('[post-exception status] ' + text); }; }; - -document.addEventListener("keydown", (function(e) { - var t = document.getElementById("canvas"), - n = new KeyboardEvent("keydown", { - key: e.key, - code: e.code, - keyCode: e.keyCode - }); - t.dispatchEvent(n) -})) - -document.addEventListener("keyup", (function(e) { - var t = document.getElementById("canvas"), - n = new KeyboardEvent("keyup", { - key: e.key, - code: e.code, - keyCode: e.keyCode - }); - t.dispatchEvent(n) -})) -- cgit v1.2.3