simulating input for XR

How about XR? What would one pass to nputSystem.QueueEvent for XR input

Due to how the XR subsystem is set up, the XR devices don’t have simple state structs. This unfortunately means that all state has to be read and written indirectly through controls.

var viveWand = InputSystem.AddDevice<ViveWand>();
using (StateEvent.From(viveWand, out var eventPtr))
{
    viveWand.grip.WriteValueIntoEvent(1f, eventPtr);
    InputSystem.QueueEvent(eventPtr);
}

Alternatively, you can make up your own versions of these devices by simply deriving a new layout that you register with InputSystem.RegisterLayout.

struct MyViveWandState : IInputStateTypeInfo
{
    public FourCC format => new FourCC('V', 'I', 'V', 'E');

    [InputControl]
    public float grip;
    //....
}

[InputControlLayout(stateType = typeof(MyViveWandState))]
public MyViveWand : ViveWand
{
}