Using msvcrt (in Windows), how to catch Enter key?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Oct 29 12:26:04 EDT 2007


On 29 oct, 09:23, Dick Moores <r... at rcblue.com> wrote:

> >while True:
> >     if msvcrt.getch() == '\r':
>
> I tried it and find that without the msvcrt.kbhit the first key I hit
> doesn't do anything. I have to hit that key again, or another key.

I'd say there is a logic error in your program then; keys don't "do
anything" by themselves.
Try posting a small sample, telling what you get and what you expect.

--
Gabriel Genellina




More information about the Python-list mailing list