author | Radek Brich <radek.brich@devl.cz> |
Sat, 21 Feb 2015 12:01:57 +0100 | |
changeset 118 | 8c7970520632 |
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) |