Forum Discussion
VishalFuturristic
2 years agoExplorer
System keyboard not opening every time in Meta quest 3 device
Hello, I want to use system keyboard to type in unity text mesh pro input field. when i clicked in input field some time it open native keyboard and sometime not (I am using meta quest 3). Is it kno...
- 2 years ago
I'm running into this issue too. I haven't found a proper solution in the several days I've spent trying to fix it.
This is my jank fix - attach this script to all your text fields (I use TMP input fields). It reopens the keyboard if it doesn't appear properly. Please don't mark this as the solution though as this is a horrible workaroundusing System.Collections; using System.Collections.Generic; using System.Threading.Tasks; using TMPro; using UnityEngine; public class OculusSystemKeyboardJankFix : MonoBehaviour { private TMP_InputField field; private void Awake() { field = GetComponent<TMP_InputField>(); field.onSelect.AddListener(s => ShowKeyboardDelay()); } private async void ShowKeyboardDelay() { await Task.Delay(500); if (!TouchScreenKeyboard.visible) { field.ActivateInputField(); TouchScreenKeyboard.Open(field.text, TouchScreenKeyboardType.ASCIICapable); } } }
Anton111111
1 year agoExpert Protege
jtriveri , VishalFuturristic , looks like i found better solution than this hack.
The first thanks xrworkout.io for idea about cause of issue. I debuged TMP_InputField
and i see that lifecycle the following: OnPointerDown call OnSelect if field is not focused. And
OnSelect call ActivateInputField. After that start keyboard showing. During this process if you click not fast called OnPointerClick that call also ActivateInputField. I think collision in this placec because we can set
m_ShouldActivateNextUpdate twice (the first from OnPointerDown and after that from OnPointerClick).
At the same time, OnPointerDown can be called a bunch of times with a long press.
As far as I can see, OnPointerDown is generally needed to highlight text using dragging and it is completely unnecessary in VR because when the keyboard is shown, the application is no longer in focus.
And in result i made custom implementation of TMP_InputField. How you see i just disabled OnPointerDown at all and call OnSelect from OnPointerClick. OnPointer click best place for it because it always call once regardless of the duration of the press and the number of calls OnPinterDown.
With this solution i don't see any issue with keyboard. But need test more time. If somebody test it too and leave feedback will be very cool.
using TMPro;
using UnityEngine.EventSystems;
public class TMPInputFieldVR : TMP_InputField
{
public override void OnPointerDown(PointerEventData eventData)
{
// Do nothing because it doesn't need for VR
}
public override void OnPointerClick(PointerEventData eventData)
{
// Call On Select when OnPointerClick fired instead of OnPointerDown
OnSelect(eventData);
}
}
jtriveri
1 year agoStart Partner
Will check this out. Thanks for diving in and potentially making something better than my awful hack lol 🙂
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 4 years ago