Read arrow keys

Ned Deily nad at acm.org
Thu Feb 21 04:36:24 CET 2013


In article <51255C8A.7090302 at bigpond.com>, Phil <phil_lor at bigpond.com> 
wrote:
> I'm attempting to put a simple remote control program together and to do 
> so I need to check if the arrows are pressed. I could probably do this 
> with pyqt4 but I'm looking for something simple to experiment with.
> 
> Pygame looked like a suitable solution but the error message makes me 
> think that pygame doesn't work from the console:
> 
> "video system not initialized"
> 
> Is there a simple way to read the direction keys within a while loop?

You don't say which o/s platform(s) you are interested in but, if they 
are all unix-y and you don't mind running from a shell terminal session, 
you could just use the venerable curses module in the Python standard 
library.

http://docs.python.org/3/library/curses.html

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list