[Python-ideas] Default value for input
random832 at fastmail.us
random832 at fastmail.us
Fri Apr 4 15:38:47 CEST 2014
On Thu, Apr 3, 2014, at 20:41, Andrew Barnert wrote:
> A get_key_press function is the _easy_ part. On Unix, you use termios to
> put stdin into raw mode then select or blocking-read stdin; on Windows,
> you use the msvcrt module to call the wrappers around the console I/O
> functions.
A _good_ get_key_press function won't return bizarre character sequences
for non-graphical keys in the first place. The msvcrt functions map a
perfectly good high-level key event object into an information-losing
abstraction designed to emulate a truly ancient MS-DOS API.
"or 1 or more UTF-16 codes (Windows), so your state is less trivial than
you're expecting…"
Yeah, and just try distinguishing an arrow key from an _actual_ keypress
of à followed by a letter.
More information about the Python-ideas
mailing list