How to check when enter key was pressed on keyboard (mobile keyboard)


I would like to know how to check if enter button was clicked on mobile keyboard(when it enters the answer) to know when it stopped typing.


Give this code a try :

 private TouchScreenKeyboard keyboard ;
 public void OnInputEvent()
    keyboard = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default, false);
 void Start () 
     AddTodoField.onEndEdit.AddListener(val =>
             if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)  || mobileKeys.done  )

have you try using keyCode? can you try?


the Key thing from @gvergidis is “mobileKeys.done”.

Let me share my experience from Android.

“Input.GetKeyDown(KeyCode.Return)” and “Input.GetKeyDown(KeyCode.KeypadEnter)” are not working for me

public InputField UserIdField;

UserIdField.onEndEdit.AddListener(val =>
    // TouchScreenKeyboard.Status.Done: Keyboard disappeared when something like "Done" button in mobilekeyboard
    // TouchScreenKeyboard.Status.Canceled: Keyboard disappeared when "Back" Hardware Button Pressed in Android
    // TouchScreenKeyboard.Status.LostFocus: Keyboard disappeared when some area except keyboard and input area
    if (UserIdField.touchScreenKeyboard.status == TouchScreenKeyboard.Status.Done)
        Debug.Log("Keyboard is Disappear pressed by Return or Done mobilekeyboard button");