tests/curses_keycodes.py
changeset 65 5f0697950f15
parent 20 472a753664f9
child 110 cf3d49cdd6e2
--- a/tests/curses_keycodes.py	Sun Jan 20 00:49:19 2013 +0100
+++ b/tests/curses_keycodes.py	Wed Jan 23 00:50:23 2013 +0100
@@ -14,14 +14,19 @@
     curses.mousemask(curses.ALL_MOUSE_EVENTS | curses.REPORT_MOUSE_POSITION)
     while True:
         c = screen.getch()
+        s = ''
 
         screen.nodelay(1)
         while c != -1:
+            try:
+                s += chr(c)
+            except ValueError:
+                s += '?'
             screen.addstr('0x%02x,' % c)
             c = screen.getch()
         screen.nodelay(0)
 
-        screen.addstr('\n')
+        screen.addstr(' %r\n' % s)
 
         screen.refresh()