diff --git a/src/browser/mouse.js b/src/browser/mouse.js index c329d885..644200f2 100644 --- a/src/browser/mouse.js +++ b/src/browser/mouse.js @@ -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;