Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Caio.Lib on June 03, 2014, 09:27:28 AM

Title: NGUI 3.6.4 - WP8 - UIInput
Post by: Caio.Lib on June 03, 2014, 09:27:28 AM
Hi!

I'm having problem with UIInput in WP8 after updating NGUI.
UIInput OnChange is firing but UIInput.current.value is empty and when I type, nothing shows in the UIInput's label property.
It's working fine in Editor and was working fine before.

BTW: I updated NGUI. The Read Me name is ReadMe - 3.6.2 but in Editor's Help it shows NGUI Documentation (v.3.6.1) is that right?

Thank you!
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: ArenMook on June 04, 2014, 12:38:53 AM
Yes, I forgot to update the menu caption to 3.6.2.

UIInput.current.value is empty... are you using hidden input keyboard type? Is it working everywhere else?
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: Caio.Lib on June 04, 2014, 10:30:52 AM
I'm using Keyboard Type: default.
I just tested it on Android, Unity's Editor and WP8. Only WP8 has the issue.

Thank you
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: Caio.Lib on June 04, 2014, 02:46:01 PM
I noticed another issue, when changing Validation to None I can type and the letters appears but like '|' and I can't remove them.

*I'm using Unity 4.5.0f6

Thank you
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: ArenMook on June 05, 2014, 12:48:03 AM
If the TouchScreenKeyboard.hideInput is true (keyboard type is set to "Hide Input") then the text will always contain an invisible "|" in it that you can never remove -- but only on the invisible keyboard's side. Since your keyboard is set to 'default', I see no reason why something like you are describing would happen. I certainly haven't heard of this issue before. There certainly is no special handling between WP8 and other mobile platforms inside UIInput.cs -- you can check the code. If it's only broken on WP8 and works everywhere else, I would strongly advise submitting a bug to Unity so that they have a look at it.

Also try creating a script yourself that simply calls
  1. TouchScreenKeyboard.Open("Some text", TouchScreenKeyboardType.Default, false, false, false, false, "");
...in its Start() function. See if it shows the same problem.
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: Caio.Lib on June 05, 2014, 01:45:16 PM
ArenMook thank you for you help,

What I realized is that TouchScreenKeyboard.hideInput in Unity 4.5 on Windows Phone is always True.
I reported the bug: http://fogbugz.unity3d.com/default.asp?612011_ed1ipc886qooun94 (http://fogbugz.unity3d.com/default.asp?612011_ed1ipc886qooun94)
I tried some changes but I messed up the code:

UIInput - 583:
  1. #if !UNITY_WP8
  2.         if (TouchScreenKeyboard.hideInput)
  3. #else
  4.         if (keyboardType == KeyboardType.HiddenInput)
  5. #endif
  6.  

I replaced all others but it stopped working.  :-[
I'll wait for the fix from Unity, the animation is having issues on Windows Phone too.

Thank you

Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: quantumfrog on June 05, 2014, 03:14:04 PM
Hi,
i can confirm this bug.
We updated to unity 4.5 and the latest ngui and after that all the Inputs are broken on Windows phone and only get "|" when typing in any character.

There are also issues switching the Input field. The Input field focus is often added and removed in one click.

A quick fix in some way would be much appreachiated :X we have to release our game next week and would prefer to do it in 4.5.
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: ArenMook on June 06, 2014, 02:28:18 AM
Sigh. Yet another bug in Unity's WP8 implementation I have to hack around...

3.6.3 is due tomorrow evening and I'll add the hack there.
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: quantumfrog on June 10, 2014, 07:30:55 AM
Thanks for the bugfix.
But there is still the focus problem. The input field only keeps its focus every ~10th click. The other times the Caret blinks one time in the input and the focus is gone.

Im using the UIInput class of 3.5.7 now. That one works fine even on W8 Phone except there is no Caret.
Title: Re: NGUI 3.6.3b - WP8 - UIInput
Post by: latas on June 12, 2014, 12:02:53 PM
I agree with that. The bug still reminds. You can verify this behavior when you touch on the UIInput controller. The | blinks once and the keyboard appears. You type, but nothing is written in the box. When you click enter there is nothing in the box.

Thank you.
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: latas on June 12, 2014, 05:04:55 PM
As I've checked, it looks when you touch the Input Controller, submit is fired. This makes the control works in a loop. When the "submit" ends you touch again to write something and it invokes submit again, and so on.
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: ArenMook on June 13, 2014, 04:17:37 AM
What causes it to fire? Why does it only break on WP8?
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: latas on June 13, 2014, 03:01:33 PM
I guess there is something different in the Unity touch manager for Windows Phone, that has some behavior different than in other platforms. If you don't have any method assigned to onClick onSubmit event, then when you touch the UIInput the cursor blinks during some milliseconds, and then back to the normal stage.

Thanks.
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: ArenMook on June 13, 2014, 10:03:19 PM
Why does clicking on an input field trigger its submit? Why do you have an OnClick notification in there? Did you attach a button component to your input field? You should attack the button with the OnClick elsewhere -- like an actual button.
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: latas on June 14, 2014, 01:17:38 AM
Sorry I didn't use the right words. I'm talking about onSubmit, not onClick. Have you tested? I think if you test it you will see very easy what happens.

Thanks.
Title: Re: NGUI 3.6.2 - WP8 - UIInput
Post by: latas on June 14, 2014, 09:13:00 AM
I've tried 3.6.4 and still fails. Do you need anything else to verify this problem? Can I help you?

Thank you.
Title: Re: NGUI 3.6.4 - WP8 - UIInput
Post by: Caio.Lib on June 14, 2014, 05:41:38 PM
As quantumfrog and latas said, the problem remains.
I'm using NGUI 3.6.4 and change event.
Title: Re: NGUI 3.6.4 - WP8 - UIInput
Post by: ArenMook on June 15, 2014, 03:33:08 AM
Skype me and let's get to the bottom of the issue.
Title: Re: NGUI 3.6.4 - WP8 - UIInput
Post by: tkok on June 16, 2014, 01:50:26 AM
Hi,
i can confirm this focus bug. I made an empty project with only two Input fields and when I start the program on WP8 I can focus on my first Input field but only once. After first focus and defocus it breaks and will only focus for a time of one frame.

EDIT: I'm using Unity 4.5.0f6 and NGUI 3.6.4
EDIT2:
I added two gui elements to watch TouchScreenKeyboard.hideInput and TouchScreenKeyboard.visible fields' values and it seems that after I touch UIInput-field visible-value goes to true for one frame and then false for one frame and after that it stays on true value untill I close the touchkeyboard.

Tomi
Skypetm: tomikokkonen
Title: Re: NGUI 3.6.4 - WP8 - UIInput
Post by: ArenMook on June 16, 2014, 08:28:16 AM
Sounds like a bug in Unity reporting the incorrect keyboard visibility state. Is it only an issue with the "hide input" option?
Title: Re: NGUI 3.6.4 - WP8 - UIInput
Post by: tkok on June 18, 2014, 01:14:40 AM
- - Is it only an issue with the "hide input" option?
I have hide input option turned off so that's not the case. I tried to turn hide input setting on but it didn't help.

EDIT1:
I made ugly fix for this. I simply wait two frames before judge if keyboard is really closed or not. That's super ugly and stupid way but I needed this to be fixed today.
In UIInput.cs I added private field
  1.     private bool skipOneInputCloseFrame = true;
  2.  
And for Line 620:
  1.                 if (mKeyboard.done || !mKeyboard.active)
  2.                 {
  3.                     if(skipOneInputCloseFrame){
  4.                         skipOneInputCloseFrame = false;
  5.                     }
  6.                     else{
  7.                                             if (!mKeyboard.wasCanceled) Submit();
  8.                                             mKeyboard = null;
  9.                                             isSelected = false;
  10.                                             mCached = "";
  11.                         skipOneInputCloseFrame = true;
  12.                     }
  13.                 }
Title: Re: NGUI 3.6.4 - WP8 - UIInput
Post by: ArenMook on June 18, 2014, 03:40:46 PM
Simply 'return' after opening the keyboard.