js: Recognise KeyboardEvent.key == "Escape"

This commit is contained in:
Ben Harris
2022-10-24 23:33:09 +01:00
parent f5ac13c847
commit 35d382019f

2
emcc.c
View File

@ -277,6 +277,8 @@ void key(int keycode, const char *key, const char *chr, int location,
keyevent = 127; /* Backspace / Delete */
else if (!strnullcmp(key, "Enter"))
keyevent = 13; /* return */
else if (!strnullcmp(key, "Escape"))
keyevent = 27;
else if (!strnullcmp(key, "ArrowLeft") || !strnullcmp(key, "Left"))
keyevent = CURSOR_LEFT;
else if (!strnullcmp(key, "ArrowUp") || !strnullcmp(key, "Up"))