5

I am using NGUI's UIInput class to accept text input from user. when i start typing in text box in mobile devices. a key board appears and it has an another textbox within it self, with "OK"/"Done" button (Like a keyboard accessory view, if we're talking about iPhone).

Can i disable that text box appearing within keyboard ? Or its not even possible and i am shooting just blanks ?

From what i could gather by search for a while is, the appearance of keyboard is handled buy Unity's "TouchScreenKeyboard" class. but according to Unity Scripting reference there is nothing which could hide the textfield inside the keyboard.

Unity Scripting reference: TouchInputKeyboard

PS:- I should still be able to put input in textbox by directly typing into them, i just want an extra textbox within the key board to be removed.

TO be more clear i have attached images explaining this

This is the screen.

enter image description here

When i start typing in one of the textbox. a keyboard appears like the following. as you can see the text box just above the keyboard is not the original one.

enter image description here

Pawan Joshi
  • 1,581
  • 3
  • 20
  • 40

3 Answers3

2

Did you try checking "Hide Input Check box" in Inspector view of that UIInput Textbox ?

Maxime Peloquin
  • 915
  • 12
  • 22
Dev_Dash
  • 376
  • 3
  • 7
0
private void OnGUI()
                     {
TouchScreenKeyboard.hideInput=true;
}
Ram
  • 3,092
  • 10
  • 40
  • 56
Pooyan
  • 33
  • 1
  • 5
0

I don't know why it is, but I have had this problem as well and the "hide input" checkbox for some reason doesn't seem to do really anything other then change the keyboard text box from one line to multi line.

I did a little bit of digging and came across a quick lead that will enable that hide input check box.

This fix is Update() in UIInput.cs around 650

else if (inputType == InputType.Password)
{
 TouchScreenKeyboard.hideInput = true;
 kt = TouchScreenKeyboardType.Default;
 val = mValue;
 mSelectionStart = mSelectionEnd;
 }
 else
 {
      if(hideInput)
      {
       TouchScreenKeyboard.hideInput = true;        
      }
      else
      {
       TouchScreenKeyboard.hideInput = false;
      }
       
 kt = (TouchScreenKeyboardType)((int)keyboardType);       
 val = mValue;
 mSelectionStart = mSelectionEnd;
}

I added a check in the else statement