Re: [Tutor] How to Capture a key being pressed?

2012-01-05 Thread Steven D'Aprano
brandon w wrote: How do I capture a key like the Space bar or the Enter key? http://code.activestate.com/recipes/577977-get-single-keypress/ -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

[Tutor] How to Capture a key being pressed?

2012-01-04 Thread brandon w
How do I capture a key like the Space bar or the Enter key? Is there anything that comes in the default Python2.6.6 installation? I have found something called termios doing a search. Should I just use Pygame? I would like it to go cross platform if possible. Brandon

Re: [Tutor] How to Capture a key being pressed?

2012-01-04 Thread Alan Gauld
On 04/01/12 18:28, brandon w wrote: How do I capture a key like the Space bar or the Enter key? It depends on your OS. For Windows use msvcrt and the getch() function. For other OS your best bet is curses. See the Event Handling topic in my tutorial for examples using both. There is a