don't send mouse events when execution is paused

This commit is contained in:
Fabian 2022-07-28 23:28:43 +09:00
parent 5c4023f17d
commit d28c77faa2

View file

@ -32,6 +32,17 @@ function MouseAdapter(bus, screen_container)
this.enabled = enabled;
}, this);
// TODO: Should probably not use bus for this
this.is_running = false;
this.bus.register("emulator-stopped", function()
{
this.is_running = false;
}, this);
this.bus.register("emulator-started", function()
{
this.is_running = true;
}, this);
this.destroy = function()
{
if(typeof window === "undefined")
@ -145,6 +156,11 @@ function MouseAdapter(bus, screen_container)
return;
}
if(!mouse.is_running)
{
return;
}
var delta_x = 0;
var delta_y = 0;