TouchScreenKeyboard done

Hi.

How can I run a function once, when the mobile user is finished using the keyboard?

This is my current code:

	public string textInput = ""; //Indtast adresse

	private string[] geoData;
	
	private TouchScreenKeyboard keyboard;

	public GameObject searchText;

	public GameObject searchObj;

	void OnMouseUpAsButton() {
	
		TouchScreenKeyboard.hideInput = true;
		if(textInput == "No input") {
			textInput = "";
		}
		keyboard = TouchScreenKeyboard.Open(textInput, TouchScreenKeyboardType.ASCIICapable,false,false,false,false);

	}


	// Update is called once per frame
	void Update () {
	
		if(keyboard != null) {

			textInput = keyboard.text;
			searchText.guiText.text = textInput;

		}

		if(keyboard != null && keyboard.done == true) {

			print("done");
			
		}

	}

However, it prints done every frame after I press the ‘Enter’ button on my mobile keyboard. How can I make this run only once?

Best regards.

Just set the keyboard field to null after you have performed the done action.