Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Keyboard does not show when pressing input field in unity?

I have a simple scene in unity which has an input field in it. When I run my scene in my Android Device and press the input field, the android keyboard does not show. I am connecting via USB to my laptop using Unity Remote 5 app.

Here is my code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;

public class InputNumber : MonoBehaviour {

    public InputField input;

    // Use this for initialization
    void Start () {
        if (input)
        {
            TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default, false, false, true);
        }
        input.keyboardType = TouchScreenKeyboardType.NumberPad;
    }

    // Update is called once per frame
    void Update () {

    }
}
like image 539
Ak Pasaf Avatar asked Oct 19 '25 17:10

Ak Pasaf


1 Answers

No need to call TouchScreenKeyboard.Open() method. The native keyboard will not show up if you are running it in Unity Remote app. But it will show up on touching input field once you build and run the app from File > Build Settings > Build or File > Build and Run.

like image 152
Ashwin Avatar answered Oct 21 '25 07:10

Ashwin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!