I purchased NGUI from the asset store about a month ago. I have been having issues with the UIInput.cs control on Windows 8.1. Same control works as expected on Windows Phone 8.
When touching the control on Windows 8.1 it seems like OnSelect does not always get called from UICamera.
On Windows phone the same UIInput.cs code is working as expected. Keyboard pops up, edit and backspace seem to work fine. On Windows 8.1 the UIInput.cs default code seems to lose focus, intermittently (every 20 or so touches) bring up the onscreen keyboard and gains focus, and backspace also does not work when focus is gained.
I made sure the UIInput control is top in the window level hierarchy. (Level 20)
I have tried a few things to get things working better-
I upgraded recently to NGUI 3.7.4 (issue was occurring before and after).
Added UNITY_WINRT || UNITY_METRO to the defines at the top for MOBILE (redundant as it may be)
For troubleshooting- I made some changes or commented out some of the UNITY_METRO specific code as it is making some items not function as expected-
Line 222-
public bool inputShouldBeHidden
{
get
{
#if UNITY_METRO
return false; //Changed from true as do not want to hide input for Windows 8
#else
return hideInput && label != null && !label.multiLine && inputType != InputType.Password;
#endif
}
}
Line 618-
//#if UNITY_METRO
// val = "";
//#else
val = "|";
//#endif
Line 666-
// #if UNITY_METRO
// string text = Input.inputString;
// if (!string.IsNullOrEmpty(text)) Insert(text);
// #else
Line 640-
For troubleshooting just took some variables out of the mix as it is for username-
mKeyboard = TouchScreenKeyboard.Open(val, kt, true, false, false, false, defaultText);
//mKeyboard = (inputType == InputType.Password) ?
// TouchScreenKeyboard.Open(val, kt, false, false, true) :
// TouchScreenKeyboard.Open(val, kt, !inputShouldBeHidden && inputType == InputType.AutoCorrect,
// label.multiLine && !hideInput, false, false, defaultText);
With the above changes in Windows 8.1, I am able to initially select, have keyboard popup, and edit (including backspace) the UIInput (in may case username edit control).
If I deselect (touch somewhere else on the screen) and try to come back to edit the it takes 20 or so touches to regain focus and have the keyboard pop back up.
I have been troubleshooting for a few days and need your help. Any help will be much appreciated. I have Skype available if you want.
Thank you!
Mark