mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-13 21:35:59 +00:00
Only do work to process text events if text input is active
Fixes https://github.com/libsdl-org/SDL/issues/9353
This commit is contained in:
@@ -837,11 +837,14 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent
|
||||
|
||||
static EM_BOOL Emscripten_HandleKeyPress(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData)
|
||||
{
|
||||
char text[5];
|
||||
if (Emscripten_ConvertUTF32toUTF8(keyEvent->charCode, text)) {
|
||||
SDL_SendKeyboardText(text);
|
||||
if (SDL_TextInputActive()) {
|
||||
char text[5];
|
||||
if (Emscripten_ConvertUTF32toUTF8(keyEvent->charCode, text)) {
|
||||
SDL_SendKeyboardText(text);
|
||||
}
|
||||
return EM_TRUE;
|
||||
}
|
||||
return SDL_EventEnabled(SDL_EVENT_TEXT_INPUT);
|
||||
return EM_FALSE;
|
||||
}
|
||||
|
||||
static EM_BOOL Emscripten_HandleFullscreenChange(int eventType, const EmscriptenFullscreenChangeEvent *fullscreenChangeEvent, void *userData)
|
||||
|
Reference in New Issue
Block a user