Automate keytrokes

I am trying to figure out how to automate some keystrokes. I know this is lame, but I am using the psX 1.13 emulator, and there is no turbo... I just want to have something to simulate a keystroke repeatedly, it would be even better if I could tie it to a specific window. Any suggestions?

Thanks in advance for any replies.

Xrunner is a Unix test tool for graphical applications that might do what you are after, this used be published by Mercury Interactive but seems to have been taken over by HP on who's site I see LoadRunner?

Eggplant may be another?