Skip to main content

Detecting a User About to Type on InputField

Due to VRChat not being the most consistent with sent UI events, especially between desktop and VR, it can be difficult to reliably detect when a user is about to start typing on a UI InputField.

During the development of Udonity I faced this specific issue with the fields on the inspectors and editor windows where values on the input fields are being updated per frame to display accurate information about the inspected objects.

In this scenario detecting the intentions of a user about to start typing on a field is necessary in order to pause the values being brute forced in while typing, which would result in user's input being rejected.

 

InputFields with no VRCInputFieldKeyboardOverride

Since VRChat 2022.2.2p3, clicking any field will display VRChat's own in-game keyboard for typing, and so far I've found one reliable solution for detecting when a user is about to start typing on a field:

  1. Add Event Trigger to the same object as the InputField:

    image.png

  2. Click Add New Event TypeInitializePotentialDrag:

    image.png

  3. Set up any events that you want to be invoked when someone is about to start typing:image.png