Search Unity

TMP Input field versus on screen keyboard

Discussion in 'UGUI & TextMesh Pro' started by LooksConfused, Aug 12, 2020.

  1. LooksConfused

    LooksConfused

    Joined:
    Feb 17, 2020
    Posts:
    16
    Hi Unity Community

    I'm currently working on an issue with inconsistencies regarding the interactions between bringing up and closing the on screen keyboard through interactions with TMP InputField. The situation is as follows:

    1. Tap the InputField (this brings up the on screen keyboard as intended).
    2. Tap anywhere outside of my on screen keyboard to close it.
    3. Tap the InputField again (this time it does NOT bring up the on screen keyboard).

    I've been testing this on android (Oneplus 6 if that matters).

    It seems to me that after the initial interaction the InputField is deemed "Selected" in Unity's UI system, and the subsequent tap on the input field after closing the keyboard does not "Re-select" the input field.

    I can bring up the keyboard again if I interact with something else than the input field, and then tap the input field again afterwards. But unfortunately it seems like the closing of the keyboard (step 2) does not count as an interaction with something else.

    Does anyone have suggestions as to how I can approach this issue, and make sure that the keyboard will be shown every time the user taps an input field?
     
  2. LooksConfused

    LooksConfused

    Joined:
    Feb 17, 2020
    Posts:
    16
    I can add that if I on the onscreen keyboard press either "ok" or the enter button, then the keyboard will close and the selected inputfield will become unselected as intended.

    The issue seems to only appear when closing the keyboard by clicking outside the keyboard area to close the keyboard.
     
  3. LooksConfused

    LooksConfused

    Joined:
    Feb 17, 2020
    Posts:
    16
    Ok, it turns out that my googling on this failed due to being too focused on the InputField aspect of things. When I searched for "EventSystem" in conjunction with "TouchScreenKeyboard", then the grim reality of things revealed itself. Turns out that this is a Unity bug, that seemingly has been coming and going a bit over the past couple of years.

    I can add that I was experiencing this issue in Unity v 2018.4.22f1.

    Here's a thread with people discussing the issue:
    https://forum.unity.com/threads/touchscreenkeyboard-bug-status-incorrect.870589/

    Here's the issue tracker on the problem:
    https://issuetracker.unity3d.com/is...ouchscreenkeyboard-status-to-done-or-canceled

    Seems like it's functional in some versions, and broken in others. For anyone else that runs into this, I hope that you'll manage to resolve it by running one of the versions where this should be resolved.
     
  4. hafizsaadcb

    hafizsaadcb

    Joined:
    Jan 15, 2024
    Posts:
    11
    I'm encountering an issue where VR mode is enabled, and I'm using raycasting to interact with my TextField (TMP InputField). Raycasting works fine with buttons and dropdowns, but when I focus on the TMP InputField and press the trigger or index button of my controller, the system keyboard doesn't show up. Am I missing something here?