Author Topic: Keyboard for Windows Store Apps still broken?  (Read 7879 times)

redmotion

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Keyboard for Windows Store Apps still broken?
« on: July 09, 2015, 05:47:44 PM »
I've been searching all over to find a post to make the Windows Store touchscreen keyboard function properly with NGUI 3.9.0 & Unity 5.1.

I've changed the opening line in UIInput.CS to

  1. #if !UNITY_EDITOR && (UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_WP_8_1 || UNITY_BLACKBERRY || UNITY_WINRT || UNITY_METRO )

Which means it pops up if you click inside a text box.

However, delete does not work. I've found several pieces of code but they are for old NGUI versions and sit inside functions/coroutines that are gone now.

Has anyone found a workaround for this?

Many thanks in advance.

redmotion

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #1 on: July 11, 2015, 04:14:23 PM »
Extra info: This is on a windows tablet - not a laptop/desktop.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #2 on: July 12, 2015, 07:57:26 PM »
I suggest you submit a bug to Unity. Anything related to something that works on one platform but doesn't work the same on another is a Unity bug that needs to be fixed.

redmotion

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #3 on: July 13, 2015, 03:11:32 AM »
Thanks for your reply. I hear what you're saying but...

The keyboard does not open on a Windows Tablet with the default NGUI code.

If I change UIInput.CS to what I mentioned in my opening post - it does open.

I have checked the keyboard for text entry boxes with uGUI to see if it was a fundamental flaw with the Unity code and how it deals with this tablet keyboards on windows. The result was - it works perfectly with uGUI.

As far as I can tell - the NGUI/UIInput.CS doesn't correctly allocate the right code to work with the screen keyboard on the WinRT platform.

All I would like is the delete key to work properly. I don't think its an unreasonable ask.

Is there something I can do to make it work?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #4 on: July 14, 2015, 11:34:37 PM »
Ah, I see what you're saying.

Do a search for "#if UNITY_METRO" in that file and try getting rid of those sections. I remember having to jump through crazy hoops trying to get input to work properly on WP8 devices, but perhaps all that mess has been already fixed and the work-arounds can be removed. For example line 623 is:
  1.  #if UNITY_METRO
  2.                                         val = "";
  3.  #else
  4.                                         val = "|";
  5.  #endif
Change it to be simply:
  1. // #if UNITY_METRO
  2. //                                      val = "";
  3. // #else
  4.                                         val = "|";
  5. // #endif

redmotion

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #5 on: July 15, 2015, 03:48:04 PM »
Many Thanks Aren. I did what you suggested on all the METRO entries in UIInput.CS

It's almost working how I'd like now. Keyboard pops up, and I can type on all the keys and use the delete.

However, I can't see the caret.

Is there a way to make it reappear?

Many thanks again for your time.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #6 on: July 16, 2015, 10:37:11 AM »
Which caret? Caret in the pop-up keyboard? That so, that's not NGUI... Or is your input hidden?

redmotion

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #7 on: July 16, 2015, 05:08:36 PM »
The text cursor that is usually a blinking line in the text entry box is hidden.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #8 on: July 16, 2015, 10:59:02 PM »
My question still stands... which text entry box? Pop-up keyboard has its own and it's different from the NGUI's one. NGUI's one is only used if you chose to hide input on UIInput.

redmotion

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #9 on: July 16, 2015, 11:46:02 PM »
The text entry box that uses a NGUI UI label script that the NGUI UI input references.

Quote
NGUI's one is only used if you chose to hide input on UIInput.

Not sure exactly what you mean. That all soft keyboards for every OS supply their own blinking text cursors for text entry boxes?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #10 on: July 21, 2015, 09:37:54 AM »
When you open the on-screen keyboard, it has its own input area with text that you type into. NGUI has no control over it. If you choose to hide this input on the UIInput script, then only the keyboard will show and the input area will not.

redmotion

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #11 on: July 21, 2015, 01:23:04 PM »
Ok. Well I'm not using the keyboard text input! I'm using the touchscreen keyboard with a standard Ngui text box.

Which has a sprite with the UI input script, and a UI label as its child. I click on it in the unity editor and the text inside the label is highlighted, a caret is visible next to the text and I can edit using the keyboard.

If I do the same on the windows store app, I get the keyboard and the ability to type the text into the UI label BUT there is no Caret.

I hope that is clear.  :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #12 on: July 24, 2015, 09:43:29 AM »
The caret only shows up if you chose the input to be hidden on the UIInput script. If you didn't, but it still doesn't show up then it sounds like it's an inconsistency between WSA and other platforms. Just make sure you check that option and the caret should become visible.

redmotion

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #13 on: July 30, 2015, 04:38:23 PM »
So I restored to the original code for UIInput.CS for my project and compiled it without any tweaks to the code - on the tablet it shows the text Caret correctly - keyboard must be opened manually and none of the keys work.

Then without changing the #if statement as my opening post - I commented out all the METRO statements as per one of your earlier posts. Result: caret still shows correctly but keyboard doesn't show up when clicking in a text entry box. So if I manually bring up the touchscreen keyboard on the tablet - most of the keys work except for the delete key.

So the only conclusion one can draw is that the code in UIInput.CS is buggy for the windows tablet platform, some code is either being used when it shouldn't be or vice versa.

Pretty sure it's only a small change that's required. Perhaps just how the delete key is read.

I hope that helps.
« Last Edit: July 31, 2015, 04:45:43 AM by redmotion »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Keyboard for Windows Store Apps still broken?
« Reply #14 on: July 31, 2015, 09:57:42 PM »
This doesn't instill me with confidence. As I mentioned I had to jump through crazy hoops to get input to work on different devices because Unity chose to handle each new platform completely differently, and what would work on one platform wouldn't work on another. Thats why UIInput is such a mess of #ifdefs. As I also mentioned earlier, check your "hide input" option. Leave it off. Don't hide your input. This should rely on OS input -- it tends to work better than when it's hidden.

The delete key is implemented by having "|" be there as text. If one frame it's there and the next it's not, it means the delete key was pressed. It's a hack, but also the only way to get it to work with hidden input.