From 4151622b9182c57e58596d25ce8193a51d982929 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 5 Jan 2014 14:02:45 -0500 Subject: [PATCH] Allowed the screenshot to be saved to a file instead of clipboard. --- punyverse/game.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/punyverse/game.py b/punyverse/game.py index 4f46e70..c3a7eae 100644 --- a/punyverse/game.py +++ b/punyverse/game.py @@ -208,7 +208,7 @@ class Applet(pyglet.window.Window): def screenshot(self): image = pyglet.image.get_buffer_manager().get_color_buffer() - if hasattr(self, '_hwnd'): + if hasattr(self, '_hwnd') and not self.modifiers & key.MOD_CTRL: from ctypes import windll, cdll from PIL import Image import tempfile @@ -247,6 +247,7 @@ class Applet(pyglet.window.Window): direction=(dx, dy, dz))) def on_mouse_press(self, x, y, button, modifiers): + self.modifiers = modifiers if not self.loaded: return @@ -264,6 +265,7 @@ class Applet(pyglet.window.Window): self.cam.mouse_move(dx * MOUSE_SENSITIVITY, dy * MOUSE_SENSITIVITY) def on_key_press(self, symbol, modifiers): + self.modifiers = modifiers if symbol == key.Q: self.screenshot() if not self.loaded: