Most input events like keyboard, mouse and pointer input are fired on IRuntime so you don't need to forward them yourself. For example you can write runtime.addEventListener("pointerdown", e => OnPointerDown(e)), just like you would with document or window in the DOM.
Thanks, that worked for detecting events! One follow-up: is there also an official way to convert the event's client coordinates into game viewport/canvas-space pixels while in Worker mode (without DOM access to the canvas element)? I need this for accurate pointer-to-world raycasting. Native plugins like Mouse expose LayerX/LayerY correctly even in Worker mode — is that conversion exposed on IRuntime or ILayer for third-party addons?
Specifically, I'm seeing correct behavior only in fullscreen mode; in windowed mode with letterboxing, there seems to be an offset I can't account for without the canvas element's bounding rect.