Any way to programmatically invoke a UI event?

I have an input field that brings up a virtual keyboard on click. When the user is done entering text, I want to send a SubmitText event to the InputField object so it can process the text. Is there a way to do that?

When your user presses the button to submit text, simply have it call a function that reads your InputField.text and parses it however you want then clears its value.

I found out the way to do it is to use the ExecuteEvents API.