UMG Slate - Bind to OnTextCommitted for an Editable Text (multiline)?

I found this answer from 2015, but it’s a bit dated and I can’t figure out how to get this to work with a UMG slate widget. How to commit text on a multi-line textbox ? - UI - Epic Developer Community Forums

I’ve got a UMG slate widget with a Multiline Editable textbox. What I’m trying to accomplish is hook into an on key down event or on text committed event so I can intercept the Enter key press and prevent a new line from being added. The purpose for this is I’m building a message box and when the user presses Enter I want their message to be sent instead of a new line added.

How can I achieve this? When I hook into the OnTextCommitted event the print string never executes. Regardless of pressing Enter or mouse clicking out of it to cause it to lose focus.

According to the documentation page here the committed event should fire on Enter press or when the textbox loses focus.

Can anyone out there help me with this?

I figured out what I was doing wrong. I was searching for OnPreviewKeyDown in the event graph (i thought it was an event), but it’s actually a function that you override.

You can get to it by clicking on the green Add New button and under the Override Function category you can find the function. Everything works as desired now.

1 Like