1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Rep Power

    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

    Any ideas?

    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?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Rep Power
    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.

IMN logo majestic logo threadwatch logo seochat tools logo