From edaf3f9c9c13bde969e1627cb9e1240da9114275 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Tue, 21 Apr 2020 15:02:06 +0100 Subject: [PATCH] emscripten: Extend the "nav key" blacklist Add the F keys and Ctrl/Alt+*. Consistent with other naviagtion disabling. Also, none of these generate keypress events anyway. --- src/video/emscripten/SDL_emscriptenevents.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index a6aa3dee4..80929af89 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -576,7 +576,10 @@ Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent *keyEvent, voi keyEvent->keyCode == 37 /* left */ || keyEvent->keyCode == 38 /* up */ || keyEvent->keyCode == 39 /* right */ || - keyEvent->keyCode == 40 /* down */; + keyEvent->keyCode == 40 /* down */ || + (keyEvent->keyCode >= 112 && keyEvent->keyCode <= 135) /* F keys*/ || + keyEvent->ctrlKey || + keyEvent->altKey; if (eventType == EMSCRIPTEN_EVENT_KEYDOWN && SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE && !is_nav_key) prevent_default = SDL_FALSE;