How to commit text on a multi-line textbox ?

Hello,

I had a text box but I needed text wrapping so I changed it for a multi-lines textbox.
My issue is that now ENTER makes a newline and does not commit. I want to change that so that ENTER commits and UPPER+ENTER does a newline. I tried adding ENTER as en input but it seems to be caught and blocked by the textbox.

What can I do ?

2 Likes

I found the answer :

Override the OnPreviewKeyDown in the Widget blueprint (HUD for me) it will get the input BEFORE the child so you can do whatever you want with it. If you reply to this event with an Handled eventreply it will not be sent to the children if you reply Unhandled then it will be sent to the children.

4 Likes

I had this problem and this solves it for me too. Thanks!

Since I’m here though, I’d thought I’d just update the solution by mentioning that with more recent versions you can have more than one return node (which have a handled/unhandled checkbox). This would simplify the blueprint script in the solution above, i.e. you no longer need the gubbins in the red boxes.

2 Likes

thanks so much for this fix mate it was drving me crazy.

Sorry to bump an old question, but i have the same issue and i don’t know how to make an input to commit the changes inside the multi line text box, how should i implement this?

I’m stuck too, how do you call the event to actually commit the text ?

If you use “set focus to game viewport” instead of whatever “send message f” is it will automatically submit as the widget has lost focus and that is default functionality.

2 Likes

Thanks, helped

Thank you

This worked great =) Thanks man!