Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MisterAndroid

Pages: [1]
1
NGUI 3 Support / Re: Keyboard of Windows Store
« on: June 24, 2014, 12:12:00 PM »
Hey Guys,

So I ran into the same problem posted above and by combining information from: http://forum.unity3d.com/threads/unity-4-5-windows-store-touch-screen-keyboard-not-working.248523/#post-1650855 and what was posted here, the edits I made to UIInput.cs (NGUI version 3.5.5) were as follows:

  1. //Change definition of mobile to include UNITY_WINRT (Metro + WP8 )
  2. #if !UNITY_EDITOR && (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WINRT)
  3.  

in OnSelectEvent()
  1. //Replace just adding the application.platform for WP8Player
  2. #if UNITY_WINRT
  3.     || Application.platform == RuntimePlatform.WP8Player
  4.     || Application.platform == RuntimePlatform.MetroPlayerARM
  5.     || Application.platform == RuntimePlatform.MetroPlayerX64
  6.     || Application.platform == RuntimePlatform.MetroPlayerX86
  7. #endif
  8. ...
  9.     mKeyboard = (inputType == InputType.Password) ?
  10.         TouchScreenKeyboard.Open(mValue, TouchScreenKeyboardType.Default, false, false, true) :
  11.         TouchScreenKeyboard.Open(mValue, (TouchScreenKeyboardType)((int)keyboardType), inputType == InputType.AutoCorrect, label.multiLine, false, false, defaultText);
  12.  
  13. //This is the only way the keyboard knows to be opened.
  14. #if UNITY_METRO
  15.     mKeyboard.active = true;
  16. #endif
  17.  

In the Mobile Update() function
  1. #if MOBILE
  2.         string mCached = "";
  3.  
  4.         void Update()
  5.         {
  6. #if UNITY_METRO
  7.         if ( isSelected )
  8.         {
  9.             string text = Input.inputString; //According to the unity forum, only way to detect key presses
  10.            
  11.             if( !String.IsNullOrEmpty(text) )
  12.             {
  13.                 if( text == "\b" ) //The only way to pick up on the backspace from Input.inputString
  14.                 {
  15.                     if( !String.IsNullOrEmpty(mCached) && !String.IsNullOrEmpty(value) )
  16.                     {
  17.                         mCached = mCached.Remove(mCached.Length - 1, 1);
  18.                         value = value.Remove(value.Length - 1, 1);
  19.                     }
  20.                 }
  21.                 else
  22.                 {
  23.                         //Since mKeyboard.text is always null, you have to accumulate the chars
  24.                         //found at the frame they are processed
  25.                         mCached += text;
  26.                         value += text;
  27.                 }
  28.             }
  29.         }
  30.     }
  31. #else
  32. ... //rest of the Mobile update function
  33.  

The limitations of this solution are that the only special keystrokes I could recognize were backspace. But it did allow us to write a simple register/login UI for our game. I hope this helps others with the same problem!

~Andrew

2
NGUI 3 Support / Re: Touch detection is off for Windows Surface Pro
« on: December 04, 2013, 04:40:56 PM »
Thank you so much for your reply!

It turns out that I somehow was missing the stickied post under the Unity Windows Development forums about this being a known issue. The way to solve it was adding "appCallbacks.AddCommandLineArg("-disable-independent-input-source")" to the App.xaml.cs that Unity generates. You can read more about the answer here:

http://forum.unity3d.com/threads/210632-Please-READ-Known-issues-in-Unity-4-3-when-deploying-for-Windows-8-1

Thanks again for taking the time to respond  :D

3
NGUI 3 Support / Touch detection is off for Windows Surface Pro
« on: December 03, 2013, 05:50:06 PM »
We're using NGUI (version 2.6.1) as our input manager, but for some reason the touches on Windows Surface Pro are off by about a third of the screen as if the touch area was smaller than the actual screen size. We're not sure if this is a problem with NGUI or an issue with how Input.touch is coming in from the Surface Pro. The app began to detect input normally after setting the option for "Change the size of apps, text, and other items on the screen" under Display settings to "Smaller". Has anyone else had similar issues with using NGUI on the Surface Pro?

Pages: [1]