aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2022-10-24 22:37:30 +0100
committerBen Harris <bjh21@bjh21.me.uk>2022-10-24 22:37:30 +0100
commit0db5fb525bb58056caf9303d2ac159fc51c04e04 (patch)
tree3c5c8e4f07ec9403732c92f285a9727220b0d89a
parent9698732d659451d5f5216834f7eea0eba46a623e (diff)
downloadpuzzles-0db5fb525bb58056caf9303d2ac159fc51c04e04.zip
puzzles-0db5fb525bb58056caf9303d2ac159fc51c04e04.tar.gz
puzzles-0db5fb525bb58056caf9303d2ac159fc51c04e04.tar.bz2
puzzles-0db5fb525bb58056caf9303d2ac159fc51c04e04.tar.xz
js: Remove the charCode argument from key()
It hasn't been used in a while.
-rw-r--r--emcc.c2
-rw-r--r--emccpre.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/emcc.c b/emcc.c
index 77e7ded..33f7608 100644
--- a/emcc.c
+++ b/emcc.c
@@ -262,7 +262,7 @@ void mousemove(int x, int y, int buttons)
/*
* 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;
diff --git a/emccpre.js b/emccpre.js
index 96a9af8..2a71875 100644
--- a/emccpre.js
+++ b/emccpre.js
@@ -311,10 +311,10 @@ function initPuzzle() {
// 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();
};