diff options
author | Gary Martin <gary@garycmartin.com> | 2010-10-06 17:56:32 (GMT) |
---|---|---|
committer | Gary Martin <gary@garycmartin.com> | 2010-10-06 17:56:32 (GMT) |
commit | 6be1dada2fde0e8e06220c9c509338c350123f0d (patch) | |
tree | 11843e9e6241b55e9b2666b9f46d7b851f0932e4 /tools.py | |
parent | a45bd81c6e7bf30d7c598c291578960a2f9b2db8 (diff) |
Watch for focus events so that pygame run loop is more gracefully idle when in background.
Diffstat (limited to 'tools.py')
-rw-r--r-- | tools.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -48,6 +48,10 @@ class Tool(object): if event.action == "stop_start_toggle": # Stop/start simulation self.game.world.run_physics = not self.game.world.run_physics + elif event.action == "focus_in": + self.game.in_focus = True + elif event.action == "focus_out": + self.game.in_focus = False elif self.game.toolList.has_key(event.action): self.game.setTool(event.action) elif hasattr(event,"code"): |