shithub: puzzles

Download patch

ref: 0db5fb525bb58056caf9303d2ac159fc51c04e04
parent: 9698732d659451d5f5216834f7eea0eba46a623e
author: Ben Harris <bjh21@bjh21.me.uk>
date: Mon Oct 24 18:37:30 EDT 2022

js: Remove the charCode argument from key()

It hasn't been used in a while.

--- a/emcc.c
+++ b/emcc.c
@@ -262,7 +262,7 @@
 /*
  * Keyboard handler called from JS.
  */
-void key(int keycode, int charcode, const char *key, const char *chr,
+void key(int keycode, const char *key, const char *chr,
          bool shift, bool ctrl)
 {
     int keyevent = -1;
--- a/emccpre.js
+++ b/emccpre.js
@@ -311,10 +311,10 @@
     // the puzzle - so users of this puzzle collection in other media
     // can indulge their instinct to press ^R for redo, for example,
     // without accidentally reloading the page.
-    key = Module.cwrap('key', 'void', ['number', 'number', 'string',
+    key = Module.cwrap('key', 'void', ['number', 'string',
                                        'string', 'number', 'number']);
     onscreen_canvas.onkeydown = function(event) {
-        key(event.keyCode, event.charCode, event.key, event.char,
+        key(event.keyCode, event.key, event.char,
             event.shiftKey ? 1 : 0, event.ctrlKey ? 1 : 0);
         event.preventDefault();
     };