ClientSim
ClientSim copied to clipboard
ClientSim calls mouse input events in a different order than VRChat
Pressing the Left mouse button in Desktop mode calls both the InputGrab and InputUse function. However, the order differs between VRChat and the current version of ClientSim.
Test code:
public class InputTester : UdonSharpBehaviour
{
int counter = 0;
public override void InputGrab(bool value, UdonInputEventArgs args)
{
Debug.Log($"{nameof(InputGrab)} called {value} at {Time.time} with counter {counter++}");
}
public override void InputUse(bool value, UdonInputEventArgs args)
{
Debug.Log($"{nameof(InputUse)} called {value} at {Time.time} with counter {counter++}");
}
public override void InputDrop(bool value, UdonInputEventArgs args)
{
Debug.Log($"{nameof(InputDrop)} called {value} at {Time.time} with counter {counter++}");
}
}
Result in ClientSim:
InputGrab is called before InputUse
Result in VRChat:
InputUse is called before InputGrab

Note: Double call of InputUse in VRChat is a known bug: https://vrchat.canny.io/vrchat-udon-closed-alpha-bugs/p/1275-inputuse-is-called-twice-per-mouse-click