From 43c89dd5e118cf244b8eb978b13fecfe2240e9e7 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 25 Oct 2022 00:50:47 +0100 Subject: [PATCH] js: Add a comment explaining the two halves of the key-matching code --- emcc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emcc.c b/emcc.c index 3f4780b..62ea9f8 100644 --- a/emcc.c +++ b/emcc.c @@ -310,6 +310,12 @@ void key(int keycode, const char *key, const char *chr, int location, else if (key && (unsigned char)key[0] < 0x80 && key[1] == '\0') /* Key generating a single ASCII character. */ keyevent = key[0]; + /* + * In modern browsers (since about 2017), all keys that Puzzles + * cares about should be matched by one of the clauses above. The + * code below that checks keycode and chr should be relavent only + * in older browsers. + */ else if (keycode == 8 || keycode == 46) keyevent = 127; /* Backspace / Delete */ else if (keycode == 13)