Hello, I'm using UIInput's onSubmit event to receive return button press on virtual keyboard on mobile devices.
The problem is that onSubmit event is raised even when I cancel input, e.g. pressing back key on Android.
I looked into UIInput class and found this check for mKeyboard.done property in Update function:
if (mKeyboard.done)
{
mKeyboard = null;
current = this;
if (onSubmit != null) onSubmit(mText);
if (eventReceiver == null) eventReceiver = gameObject;
eventReceiver.SendMessage(functionName, mText, SendMessageOptions.DontRequireReceiver);
current = null;
selected = false;
}
So, event actually raised any time when keyboard is "done".
When I added checking for mKeyboard.wasCanceled property, then script works as expected.
if (mKeyboard.done && !mKeyboard.wasCanceled)
Maybe there is a way to check if keyboard input was cancelled without modifying NGUI script?
Thanks in advance.