Hi guys. I'm trying to detect submit on inputfield. I found this code; Code (JavaScript): import UnityEngine.UI; public var myInput : InputField; function Start(){ myInput.onSubmit.AddListener(myInputSubmit); } function myInputSubmit(){ Debug.Log("test"); } It's work on desktop, but not works on Android. How can handle this?
Not sure what you are looking for but you could leverage: Code (JavaScript): if (GUI.changed) { Debug.Log("Text field has changed."); // do something }
I'm looking for this buttons click event; Or might be keyboard close event, if is exists Thank you for reply
Thank you man, you are awesome! Here is my code; I used Text instead of InputField. You must be call openKeyboard function on myText clicked. Code (JavaScript): import UnityEngine.UI; public var myText : Text; // this your input field private var Keyboard : TouchScreenKeyboard; private var isKeyboardOpen : boolean; private var KeyboardText : String = ""; // default text function openKeyboard(){ Keyboard = TouchScreenKeyboard.Open(KeyboardString, TouchScreenKeyboardType.Default); isKeyboardOpen = true; } function Update(){ if(isKeyboardOpen && Keyboard){ if (Keyboard.done){ //keyboard submitted isKeyboardOpen = false; myText.text = KeyboardText; //do your staff } if(Keyboard) KeyboardText = Keyboard.text; } }