Hello,
On the client side, I am using the Android “Hello Cloud XR” sample that shipped with the SDK, with some minor modifications. It sends touchscreen inputs to the CloudXR server with cxrSendInputEvent():
// Send a touch event along to the server/host application
void HandleTouch(float x, float y) {
if (!IsRunning()) return;cxrInputEvent input; input.type = cxrInputEventType_Touch; input.event.touchEvent.type = cxrTouchEventType_FINGERUP; input.event.touchEvent.x = x; input.event.touchEvent.y = y; cxrSendInputEvent(cloudxr_receiver_, &input);
}
Server-side, I have a Unity 2020.3.0f1 project that uses Unity’s “new input system”. How can I listen for touchscreen events and act accordingly? If I try to inspect Touchscreen.current, it is null. If I add a listener to InputSystem.onEvent, I only get HeadTrackingOpenXR events.
Is there a better way to do this? Or do I need to roll my own system using custom events and memory-mapped files?
Thanks,
David