simple input that can understand special keys?

G

Gabriel B.

i'm writting an application that will use Tinker in a newer future.
Now it's console only. I simply ommit some data on the display,
print() some other and go on. The problem is that i can't test the
actions tiggered by special keys, like Page Up/Down or the F1...12

Right now i'm using raw_input() since even the Tk version will have
only one input place, and for debuging i'm literally writting pageup,
pagedow and the F's. But i want to put it in test while i write the
GUI.

is there any hope for me? I wanted to stay only with the console for
now. And it's windows by the way :)

Thanks
 
T

Tim G

Gabriel said:
i'm writting an application that will use Tinker in a newer future.
Now it's console only. I simply ommit some data on the display,
print() some other and go on. The problem is that i can't test the
actions tiggered by special keys, like Page Up/Down or the F1...12

Right now i'm using raw_input() since even the Tk version will have
only one input place, and for debuging i'm literally writting pageup,
pagedow and the F's. But i want to put it in test while i write the
GUI.

is there any hope for me? I wanted to stay only with the console for
now. And it's windows by the way :)

Thanks

This is a notoriously un-cross-platform sort of issue.
Don't know about Tk, but for Windows, you could
use one of the existing console/curses packages:

Chris Gonnerman's WConIO:
http://newcenturycomputers.net/projects/wconio.html

The effbot's console module:
http://effbot.org/zone/console-index.htm

or a Win32 curses port:
http://flangy.com/dev/python/curses/

or you could splash out a bit and go for Pygame,
which gives you pretty much complete control over
pretty much everything:
http://pygame.org

or you could use the part-of-the-batteries mscvrt
module:
http://www.python.org/doc/2.4/lib/msvcrt-console.html


TJG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top