I know how to hide or display Virtual Keyboard using InputMethodManager
.
But I want to enter text in EditText
using Physical keyboard but I don
There is no such thing as EditText
in Unity. InputField is used to receive input from a device.
You can disable Virtual Keyword with InputField
on Android. Not sure if this will work for other platforms.
Your InputField:
public InputField inputField;
Disable Virtual Keyboard:
inputField.keyboardType = (TouchScreenKeyboardType)(-1);
Enable Virtual Keyboard:
inputField.keyboardType = TouchScreenKeyboardType.Default;
If you run into weird issues, consider deriving your script from InputField
, then disable Virtual Keyboard and finally, call the base Start
function of the InputField
:
public class HideVirtualKeyboard : InputField
{
protected override void Start()
{
keyboardType = (TouchScreenKeyboardType)(-1);
base.Start();
}
}