- Home /
Deactivate input field, NOT set interactable to false
How do I ensure my inputfield in UI 4.6 stops picking up keyboard input after I have submitted using enter or clicked on another object?
Setting intractable to false makes the input field no longer pickup mouse clicks.
This is a clarification of this question:
http://answers.unity3d.com/questions/867313/ui-46-input-field-how-do-i-use-the-onendedit.html
I have tried the following but this doesn't work:
myInput.onEndEdit.AddListener(delegate{StopInput(myInput);});
void StopInput(InputField _input) {
print (_input.text);
_input.DeactivateInputField ();
}
Where myInput is a inputfield created in c#.
Your answer
Follow this Question
Related Questions
Masked InputField on Unity UI 4 Answers
Multiple Buttons To Use One Text Input Field 1 Answer
UI 4.6 input field how do I use the .onendedit? 1 Answer
Request feedback for C# script (instantiating UI elements depending on Player Input) 0 Answers
Anyone know why my InputField is not being disabled? 0 Answers