- Home /
Question by
DanOtt · Oct 07, 2020 at 12:56 PM ·
uimobileinputfieldtouchscreenkeyboardmobile keyboard
TMP InputField does not fire onTouchScreenKeyboardStatusChanged event when keyboard becomes visible
I'm using Unity 2019.4.11f1, IL2CPP and implemented functionality to focus on the active input field. My first approach was using the onSelect & onDeselect events but when testing on Android I noticed that there are issues when tapping on the same inputfield again.
So I tried using the onTouchScreenKeyboardStatusChanged instead but this event is only fired for focus lost, done & cancel situations - but not for the visible state (when the touch screen keyboard becomes visible). I tested with Visual Studio's debugger attached to my android phone.
Am I doing something wrong here or is this simply not implemented or a bug?
private void OnEnable()
{
inputField.onTouchScreenKeyboardStatusChanged.AddListener(OnTouchScreenKeyboardStatusChanged);
}
[..]
public void OnTouchScreenKeyboardStatusChanged(TouchScreenKeyboard.Status status)
{
Scroll(status == TouchScreenKeyboard.Status.Visible);
}
Comment