mirror of https://github.com/encounter/SDL.git
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.
This commit is contained in:
parent
82a96afa70
commit
edaf3f9c9c
|
@ -576,7 +576,10 @@ Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent *keyEvent, voi
|
||||||
keyEvent->keyCode == 37 /* left */ ||
|
keyEvent->keyCode == 37 /* left */ ||
|
||||||
keyEvent->keyCode == 38 /* up */ ||
|
keyEvent->keyCode == 38 /* up */ ||
|
||||||
keyEvent->keyCode == 39 /* right */ ||
|
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)
|
if (eventType == EMSCRIPTEN_EVENT_KEYDOWN && SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE && !is_nav_key)
|
||||||
prevent_default = SDL_FALSE;
|
prevent_default = SDL_FALSE;
|
||||||
|
|
Loading…
Reference in New Issue