Skip to content

Commit

Permalink
Insert a newline into the editbox when enter is pressed.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 7, 2024
1 parent ac26c5d commit 9cbd8e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/editbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9cbd8e4

Please sign in to comment.