SDL_TextInput behaviour


I try to modify a predefined text with SDL, but recognized, that the
SDL_KEYDOWN event is only triggered, when I first wrote characters.

So if I have a predefined text of “Hello world” and then start the event
poll, I cannot delete any character. But if I enter some characters, I
can delete as much characters as I typed in. When I added e.g. " new "
to have a text “Hello new world”, I can delete only 5 characters (“new
and the two spaces” of this string. No matter where I place my cursror.

Is there a counter which tells me how much characters I typed in, so it
will not underrun the line? Or is the complete edit text stored?
event.edit.text is not writeable and event.text.text only has the newly
typed in characters.

How can I tell SDL that there is text which I handle by myself?

Thank you.

Thore Sittly