From 9cbd8e4bbed1d1238134ef20c2c88b13fbeaeb33 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 6 Oct 2024 23:39:40 -0700 Subject: [PATCH] Insert a newline into the editbox when enter is pressed. --- examples/editbox.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/editbox.c b/examples/editbox.c index 112c6541..d9e807f7 100644 --- a/examples/editbox.c +++ b/examples/editbox.c @@ -954,6 +954,10 @@ bool EditBox_HandleEvent(EditBox *edit, SDL_Event *event) } break; + case SDLK_RETURN: + EditBox_Insert(edit, "\n"); + break; + case SDLK_ESCAPE: EditBox_SetFocus(edit, false); break;