|
@@ -458,7 +458,7 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent
|
|
|
SDL_WindowData *window_data = (SDL_WindowData *)userData;
|
|
|
SDL_Scancode scancode = Emscripten_MapScanCode(keyEvent->code);
|
|
|
SDL_Keycode keycode = SDLK_UNKNOWN;
|
|
|
- SDL_bool prevent_default = SDL_TRUE;
|
|
|
+ SDL_bool prevent_default = SDL_FALSE;
|
|
|
SDL_bool is_nav_key = SDL_FALSE;
|
|
|
|
|
|
if (scancode == SDL_SCANCODE_UNKNOWN) {
|
|
@@ -511,9 +511,9 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent
|
|
|
}
|
|
|
|
|
|
if (keycode != SDLK_UNKNOWN) {
|
|
|
- SDL_SendKeyboardKeyAndKeycode(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, keycode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED);
|
|
|
+ prevent_default = SDL_SendKeyboardKeyAndKeycode(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, keycode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED);
|
|
|
} else {
|
|
|
- SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED);
|
|
|
+ prevent_default = SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED);
|
|
|
}
|
|
|
|
|
|
/* if TEXTINPUT events are enabled we can't prevent keydown or we won't get keypress
|