Message169272
> If the function returned either a single-character unicode string or an
integer
> keycode, this would also make it possible to completely drop the
is_key_code
> part of the return value. (Callers could simply check the type of the
return
> value to see if it is a keycode.)
I tried to mimic the getkey() function, but I like your idea. In many cases
you don't have to check explicitly the type. Example: if key == "q":
quit(), or if key == curses.KEY_UP: move(1). It works also if the key is
used as a key of a dictionary: key => callback. And yes, keyname() can be
used to mimic manually getkey() behaviour.
It does not solve unget_wch() issue, but I propose to drop the
unget_wch()+get_wch() test on non-ASCII keys because it looks like a bug in
the curses library. |
|
Date |
User |
Action |
Args |
2012-08-28 10:54:14 | vstinner | set | recipients:
+ vstinner, loewis, georg.brandl, Arfrever, simpkins |
2012-08-28 10:54:13 | vstinner | link | issue15785 messages |
2012-08-28 10:54:13 | vstinner | create | |
|