How to hide the keyboard in android when inputfield is active(dont want the keyboard to popup when i

  • I am trying to build an app which scans the qr code with a device,the result of the qrcode appears on the input field after scanning.but when the inputfield is active the keyboard appears.

  • i dont want thekey board to be appear on the screen when the input field is active

  • Is their any other method that i could use to take the input from the scanning device.

You can write your custom inputfield based on:
https://bitbucket.org/Unity-Technologies/ui/src/0155c39e05ca5d7dcc97d9974256ef83bc122586/UnityEngine.UI/UI/Core/InputField.cs?at=5.2&fileviewer=file-view-default

or you can try calling TouchScreenKeyboard.hideInput = true whenever the field gets focus.

Instead of using a InputText use a regular Text and fill it with Input.inputString every frame.
In my case I call the following function every frame just to fill the invisibleText wich is a regular text.

 public void ComputeInputString()
    {
        foreach (char c in Input.inputString)
        {
            if (c == '\b') // has backspace/delete been pressed?
            {
                if (invisibleInputText.text.Length != 0)
                {
                    invisibleInputText.text = invisibleInputText.text.Substring(0, invisibleInputText.text.Length - 1);
                }
            }
           
            else
            {
                invisibleInputText.text += c;
            }
        }
    }