equal
deleted
inserted
replaced
12 screen.scrollok(1) |
12 screen.scrollok(1) |
13 curses.nl() |
13 curses.nl() |
14 curses.mousemask(curses.ALL_MOUSE_EVENTS | curses.REPORT_MOUSE_POSITION) |
14 curses.mousemask(curses.ALL_MOUSE_EVENTS | curses.REPORT_MOUSE_POSITION) |
15 while True: |
15 while True: |
16 c = screen.getch() |
16 c = screen.getch() |
|
17 s = '' |
17 |
18 |
18 screen.nodelay(1) |
19 screen.nodelay(1) |
19 while c != -1: |
20 while c != -1: |
|
21 try: |
|
22 s += chr(c) |
|
23 except ValueError: |
|
24 s += '?' |
20 screen.addstr('0x%02x,' % c) |
25 screen.addstr('0x%02x,' % c) |
21 c = screen.getch() |
26 c = screen.getch() |
22 screen.nodelay(0) |
27 screen.nodelay(0) |
23 |
28 |
24 screen.addstr('\n') |
29 screen.addstr(' %r\n' % s) |
25 |
30 |
26 screen.refresh() |
31 screen.refresh() |
27 |
32 |
28 curses.wrapper(doStuff) |
33 curses.wrapper(doStuff) |