- Home /
touchscreen mobile keyboard won't input to text mesh in windows phone 8.1
I have a text mesh that is attached to a gameobject in which people will type a username. Whenever I call open the touchscreen keyboard I have been unable to get it to recognize any typing and have that typing show up as the text mesh. I have tried several variations of code after researching and looking at these answers http://answers.unity3d.com/questions/746682/how-to-use-and-test-the-virtual-keyboard-in-window.html http://answers.unity3d.com/questions/830660/windows-phone-81-touchkeyboard-problem.html
Here is my latest version of code I have tried and still had no success.
void inputActive() {
inputNameObject.transform.position = new Vector3(0f, 2.87f, -2f);
keyboard = TouchScreenKeyboard.Open(username, TouchScreenKeyboardType.Default,false, false, false,false,"hola");
StartCoroutine(ProfileName(keyboard));
}
public IEnumerator ProfileName(TouchScreenKeyboard m_keyboard) {
if (!m_keyboard.active) {
username = Input.inputString;
inputName.text = "done";
inputNameObject.transform.position = new Vector3(0f, -4.17f, -2f);
}else {
foreach (char c in Input.inputString) {
if (c == '\b' && username.Length > 0) {
username = username.Substring (0, username.Length - 1);
}else if (c == '\n' || c == '\r') {
m_keyboard.active = false;
}else {
username += c;
}
}
}
inputName.text = username;
yield return new WaitForEndOfFrame();
}
void SetText(string profileusername) {
inputName.text = profileusername;
}
It builds fine and will run on all the WP 8.1 emulators, but the typing on the emulator keyboard gives me no results. I would try it on my lumia 920, but I have not been able to get the stupid thing to register and connect with Visual Studio 2013 (it may be because it no longer has an active sim card, but I would like to think you could still develop on non-cell connected phone since I can still get OS updates with developer preview). I have spent about 6 hours on this and have come up empty so far. Any help would be greatly appreciated.