Hello Tasharen team,
I found that I often need to handle situation when mobile keyboard was canceled by user (He touched outside of keyboard). You reset the state like this:
Update function:
if (!mKeyboard.wasCanceled) Submit();
mKeyboard = null;
isSelected = false;
mCached = "";
I did small update which I guess can be handy for all:Event declaration:
public List
<EventDelegate
> onCanceled
= new List
<EventDelegate
>();
Update function:
if (!mKeyboard.wasCanceled) Submit();
else Canceled();
mKeyboard = null;
isSelected = false;
mCached = "";
Canceled function:
public void Canceled()
{
if (NGUITools.GetActive(this))
{
if (current == null)
{
current = this;
EventDelegate.Execute(onCanceled);
current = null;
}
}
}