sdlterm/cython/sdlterm.pyx
changeset 57 911927edbdde
parent 55 1ab0edd5d784
child 67 71f60bf6ebb7
--- a/sdlterm/cython/sdlterm.pyx	Mon Jan 07 23:15:17 2013 +0100
+++ b/sdlterm/cython/sdlterm.pyx	Tue Jan 08 01:12:07 2013 +0100
@@ -48,7 +48,7 @@
         void show_cursor(int x, int y)
         void hide_cursor()
 
-        void get_next_event(Event event)
+        bool wait_event(Event event, int timeout) except +
 
         int get_width()
         int get_height()
@@ -85,8 +85,10 @@
     def hide_cursor(self):
         self.thisptr.hide_cursor()
 
-    def get_next_event(self):
-        self.thisptr.get_next_event(self.event)
+    def wait_event(self, timeout):
+        if not self.thisptr.wait_event(self.event, timeout or 0):
+            # timeout
+            return None
         event = self.event
         if event.type == event.MOUSEMOVE:
             return ('mousemove', event.mouse.x, event.mouse.y)