ClientSim icon indicating copy to clipboard operation
ClientSim copied to clipboard

ClientSim calls mouse input events in a different order than VRChat

Open iffn opened this issue 2 years ago • 0 comments

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 ClientSimTest

Result in VRChat:

InputUse is called before InputGrab image

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

iffn avatar Mar 10 '23 11:03 iffn