diff --git a/src/text_editor/event.cpp b/src/text_editor/event.cpp index 180c6d5..cb7bb1a 100644 --- a/src/text_editor/event.cpp +++ b/src/text_editor/event.cpp @@ -455,9 +455,17 @@ Event TranslateSDLEvent(SDL_Event *input_event) { } inline void AddEvent(Array *events, Event ev) { - if (ev.kind == EVENT_TEXT_INPUT && (ev.ctrl || ev.alt || ev.super)) { + bool any_special_modifiers = (ev.ctrl || ev.alt || ev.super); + if (ev.kind == EVENT_TEXT_INPUT && any_special_modifiers) { return; } + + if (ev.kind == EVENT_KEY_PRESS && !any_special_modifiers && ev.key >= SDLK_A && ev.key <= SDLK_Z) { + if (ev.key != SDLK_RETURN) { + return; + } + } + if (ev.kind == EVENT_NONE) { return; }