author | Radek Brich <radek.brich@devl.cz> |
Wed, 03 Sep 2014 19:17:04 +0200 | |
changeset 112 | ce2e67e7bbb8 |
parent 110 | cf3d49cdd6e2 |
permissions | -rwxr-xr-x |
110
cf3d49cdd6e2
Add cursesw driver, using curses get_wch() for unicode input. It alse has enabled keypad() to let curses interpret control keys and mouse input.
Radek Brich <radek.brich@devl.cz>
parents:
20
diff
changeset
|
1 |
#!/usr/bin/python3 |
19 | 2 |
|
3 |
import curses |
|
4 |
import locale |
|
5 |
||
6 |
locale.setlocale(locale.LC_ALL, "") |
|
7 |
||
8 |
def doStuff(stdscr): |
|
9 |
message = "Žlutý kůň.\nPress 'q' to quit.\n" |
|
10 |
stdscr.addstr(0, 0, message, 0) |
|
11 |
while True: |
|
12 |
c = stdscr.getch() # pauses until a key's hit |
|
13 |
if c == ord('q'): |
|
14 |
break |
|
15 |
stdscr.addch(c) |
|
16 |
||
17 |
curses.wrapper(doStuff) |