keypressed...

Peter Hansen peter at engcorp.com
Sun Feb 9 21:32:32 EST 2003


gabor wrote:
> 
> i need something like this:
> -------------------------------------------
> while True:
>         if keypressed():
>                 key = getPressedKey()
>                 dosomething(key)
> --------------------------------------------
> 
> are there any functions for that ( keypressed, getpressedkey )?

When posting such questions, always include information about
the intended platform on which you want to run the program.

I'm going to assume you are on Windows, and point to the msvcrt
module which provides the required functionality.  If my 
assumption is wrong, please provide adequate detail.  This
capability is not available in a cross-platform manner.

-Peter




More information about the Python-list mailing list