Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: remiha on June 20, 2013, 11:19:02 PM

Title: Keyboard on windows 8 with UIInput
Post by: remiha on June 20, 2013, 11:19:02 PM
Hello,

In UIinput.cs there is an automtic OS keyboar for IPHONE & ANDROID.   keyboard = TouchScreenKeyboard.Open(inputURL, TouchScreenKeyboardType.URL);
but i put my game on windows 8 and surprice there is not detection for windows 8, so no keyboard in UIinputlabel. So can you give a UIinput that works for windows 8.

Thank you
Title: Re: Keyboard on windows 8 with UIInput
Post by: Nerosam on January 14, 2014, 09:19:44 PM
I second this. Or is there a way to invoke the keyboard on windows 8 another way?
Title: Re: Keyboard on windows 8 with UIInput
Post by: ArenMook on January 14, 2014, 09:32:03 PM
Eh? NGUI 3 had Win8 support since... ages ago.
Title: Re: Keyboard on windows 8 with UIInput
Post by: Nerosam on January 14, 2014, 09:37:07 PM
Sorry, i meant software keyboard support. I cant seem to input anything on my app via my tablet since it hasnt got a physical keyboard although my android build shows its software keyboard and an input field to enter characters into.
Title: Re: Keyboard on windows 8 with UIInput
Post by: ArenMook on January 14, 2014, 09:43:27 PM
Yup, it should. Line 351 of UIInput.cs is for Win8. The entire statement is:
  1. #if MOBILE
  2.                         if (Application.platform == RuntimePlatform.IPhonePlayer ||
  3.                                 Application.platform == RuntimePlatform.Android
  4. #if UNITY_WP8
  5.                                 || Application.platform == RuntimePlatform.WP8Player
  6. #endif
  7. #if UNITY_BLACKBERRY
  8.                                 || Application.platform == RuntimePlatform.BB10Player
  9. #endif
...as you can see Win8 player is a part of it. What version are you using?
Title: Re: Keyboard on windows 8 with UIInput
Post by: Nerosam on January 15, 2014, 07:56:50 AM
I see. I'm currently on version 3.0.8 f1.

What you have added is support only for windows phone 8 (WP8Player). There needs to be statements for MetroPlayerX86 and MetroPlayerARM which unity (epically) failed to add to their documentation. I'll add them myself for now.

Thanks for pointing out that line!
Title: Re: Keyboard on windows 8 with UIInput
Post by: Nerosam on January 30, 2014, 06:42:50 PM
I hate to be a pest but i'm quite stumped on how to go about modifying the UIInput.cs file. I do know that there needs to be #ifdef's for UNITY_METRO but I can't seem to get a clear solution working.

Does anyone happen to have a good UIinput implementation which works well with windows 8 tablets coded? Or at least a work around which invokes the keyboard and takes in values?

Thanks
Title: Re: Keyboard on windows 8 with UIInput
Post by: danglingneuron on January 31, 2014, 11:20:14 AM
Unfortunately for Windows 8 (RT/PRO) there is no programmatic API to bring out the Software Keyboard. The only way the software keyboard comes out is when you tap/click inside a textbox.

Now windows 8 doesnt know anything about Unity/NGUI stuff so it cant "detect" that the NGUI textbox is actually a textbox. There are two workarounds for this issue:

1. Create an input form in native windows 8 (XAML), invoke that for input so that there are native textboxes and tapping those will automatically bring out the keyboard

2. Create a native textbox (XAML), make it transparent and manage to overlay it over NGUI textbox (this can be tricky).

For both solutions, you will have to code them in the Visual Studio Project... in the native technology (e.g. C#/XAML )