tuikit/driver/cursesw.py
changeset 119 dd91747504dd
parent 118 8c7970520632
--- a/tuikit/driver/cursesw.py	Sat Feb 21 12:01:57 2015 +0100
+++ b/tuikit/driver/cursesw.py	Sun Feb 22 09:53:13 2015 +0100
@@ -170,6 +170,8 @@
             List of Event objects.
 
         """
+        res = []
+
         # Set timeout
         if timeout is None:
             # wait indefinitely
@@ -183,9 +185,11 @@
             self.stdscr.nodelay(1)
 
         # Get key or char
-        c = self.stdscr.get_wch()
-
-        res = []
+        try:
+            c = self.stdscr.get_wch()
+        except curses.error:
+            # No input in nodelay mode, or timeout
+            return res
 
         if c == -1:
             # Timeout