I do not know how to enable/disable mouse, touch and keyboard events in my situation.
My situation is that I have a PlayCanvas that overlaps a html page.
When my game on the canvas is not active I would like that the mouse, touch and keyboard events are handeld by the underlaying html page.
But when my game is active, PlayCanvas should handle the events.
How can I do that?
To get a feeling of how things work I compared this:
const app = new pc.Application(canvas, {
mouse: new pc.Mouse(canvas),
touch: new pc.TouchDevice(canvas),
keyboard: new pc.Keyboard(window),
graphicsDeviceOptions: { alpha: true },
});
with this:
const app = new pc.Application(canvas, {
//mouse: new pc.Mouse(canvas),
//touch: new pc.TouchDevice(canvas),
//keyboard: new pc.Keyboard(window),
graphicsDeviceOptions: { alpha: true },
});
But in both cases the events are not passed to the html.
How can I make the events handled by the html?