js: Remove the charCode argument from key()

It hasn't been used in a while.
This commit is contained in:
Ben Harris
2022-10-24 22:37:30 +01:00
parent 9698732d65
commit 0db5fb525b
2 changed files with 3 additions and 3 deletions

2
emcc.c
View File

@ -262,7 +262,7 @@ void mousemove(int x, int y, int buttons)
/* /*
* Keyboard handler called from JS. * 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) bool shift, bool ctrl)
{ {
int keyevent = -1; int keyevent = -1;

View File

@ -311,10 +311,10 @@ function initPuzzle() {
// the puzzle - so users of this puzzle collection in other media // the puzzle - so users of this puzzle collection in other media
// can indulge their instinct to press ^R for redo, for example, // can indulge their instinct to press ^R for redo, for example,
// without accidentally reloading the page. // without accidentally reloading the page.
key = Module.cwrap('key', 'void', ['number', 'number', 'string', key = Module.cwrap('key', 'void', ['number', 'string',
'string', 'number', 'number']); 'string', 'number', 'number']);
onscreen_canvas.onkeydown = function(event) { 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.shiftKey ? 1 : 0, event.ctrlKey ? 1 : 0);
event.preventDefault(); event.preventDefault();
}; };