August 16th, 2005, 02:28 AM
Unbuffered input -- emulating key presses
I play a couple games through cedega.
I want to create a macro, so that whenever I start to talk it changes the color to of my text.
I was thinking that in order to do this -- I would have to have python search for unbuffered input of my key to talk, then emulate key strokes into the game -- particularly ^7
I googled for "python unbuffered input" and I got something called 'getch()'
Is this along the correct lines?
How would I emulate keystrokes to the program?
August 16th, 2005, 07:29 AM
umm, are you meaning talking through the game or talking in real life, like to your computer?
I am not sure why exactly you want an unbuffered input in python. Python generally handles buffering input very well to the point it isn't even noticed, for most things.
The getch() method is part of the Curses module, which is a speical module for teminal handling. I don't think that is what you are looking for. I really don't think there is a true way to not buffer it from userinput, well I know you can unbuffer the lowerlevel socket module for input from the person your connected too.
For emulating a keyboard, I have no idea. Since your game I would think is gui based, sorry i don't know what that game is. I don't know if the sub_proccess module will allow you to controle it. But i would start with the sub_proccess module for tools on emulating user input with a program.