Author Topic: NGUI 3.6.4 - iOS - UIInput: Hide input  (Read 7685 times)

tkok

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
NGUI 3.6.4 - iOS - UIInput: Hide input
« on: June 16, 2014, 04:01:20 AM »
Hi,

I'm having trouble with NGUI's new Hide Input feature. On iOS platform if I have Hide Input activated and max line of label set to 1 it does not show os-inputfield so that works right! But when I try to type with an iPhone all the characters are uppercased. After every key push Touchscreen keyboard's shift button flashes and I think it iOS thinks (for some reason) it is first letter. I can get lower case characters if I press shift individually for every key push.

EDIT: I tested this with an empty Unity project and clean NGUI (3.6.4) inport. My Unity version is 4.5.0f6 and iOS version is 7.1.1 (11D201) on iPhone 5S.

Tomi
« Last Edit: June 16, 2014, 04:12:37 AM by tkok »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.6.4 - iOS - UIInput: Hide input
« Reply #1 on: June 16, 2014, 08:35:40 AM »
Technically it's the second letter. When the input is hidden, what NGUI does is fills the character string with "|" -- a single character. When you type anything, it gets added, such as "|a". When you delete a character, it gets removed, ie: "". That's how NGUI detects input. It was the only way to make it work properly together with the ability to move the cursor, select, edit, cut, etc via NGUI.

My guess is that iOS believes that the letter you type is indeed the first letter of a sentence, thus force-capitalizing it. Is there any way to turn this off? You can turn off auto-correct on the input. Does it affect it?

tkok

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: NGUI 3.6.4 - iOS - UIInput: Hide input
« Reply #2 on: June 17, 2014, 02:31:56 AM »
Is there any way to turn this off? You can turn off auto-correct on the input. Does it affect it?

Thank you for the answer ArenMook! I have Auto-Correct settings set off both: NGUI's UIInput's Input type is set to standard and from my iPhone I set auto-correct off. But it didn't help. In iPhone's settings there are separated setting for force-capitalizing and turning it off helped and all works great now. I don't still think my users are willing to change this setting just because one application doesn't work. Is there any work around solution suggest?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.6.4 - iOS - UIInput: Hide input
« Reply #3 on: June 17, 2014, 01:37:32 PM »
Good question. Is there a way to turn it off in Unity? I don't even see an option that would force-capitalize something in TouchScreenKeyboard.Open.

hrlarsen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 35
    • View Profile
Re: NGUI 3.6.4 - iOS - UIInput: Hide input
« Reply #4 on: June 27, 2014, 03:34:41 AM »
I came across the same issue, did you find a solution to this tkok?

hrlarsen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 35
    • View Profile
Re: NGUI 3.6.4 - iOS - UIInput: Hide input
« Reply #5 on: June 29, 2014, 10:29:30 AM »
Hi again,

I have tried to figure out a solution for this problem, and as long as Unity doesn't support a solution, I guess we have to hack our way around it. You can have your users use their prefered setting, while disabling Auto-Capitalization on a app basis. The solution I found was to modify the unity xcode scripts.

When in Xcode go to Classes > UI > keyboard.mm and insert "textField.autocapitalizationType = UITextAutocapitalizationTypeNone;" after line 141 (or somewhere around that)
 
I've attached a screenshot for reference

However, you will have to complete this step everytime you make a new build unfortunately :(

EDIT: Found that the line kept when building the project again, when just hitting build and run (cmd + b), but not when building and activily selecting replace
« Last Edit: June 29, 2014, 11:31:03 AM by hrlarsen »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.6.4 - iOS - UIInput: Hide input
« Reply #6 on: June 29, 2014, 09:56:25 PM »
Thanks for looking into this!

tkok

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: NGUI 3.6.4 - iOS - UIInput: Hide input
« Reply #7 on: June 30, 2014, 12:20:03 AM »
I came across the same issue, did you find a solution to this tkok?

My solution was build my project without NGUI's UIInput's hide settings. Thank you for your fix suggestion :)

hrlarsen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 35
    • View Profile
Re: NGUI 3.6.4 - iOS - UIInput: Hide input
« Reply #8 on: June 30, 2014, 03:03:48 AM »
Now we can just hope for Unity to make a fix for it, I found a suggestion for it on Unity Feedback http://feedback.unity3d.com/suggestions/touchscreenkeyboard-auto-capitalization-support