views:

633

answers:

3

I have an OpenGL/GLUT program running on my linux machine that views a 3D model from various angles and can take screenshots, and everything is controlled from the keyboard. I want to write a script that moves around the model in a particular way, taking screenshots at every step. It seems there should be a simple way in Linux to send keystrokes to this application from a script. Anyone know how?

+1  A: 

Take the GLUT source-code and make it remote controllable. One way to do this is to remove the function that polls the keyboard and let it poll a socket instead. Link the program with the existing program with the new library.

Afterwards you can establish a connection to the now remote-controllable program and set key-codes programmatically from your app.

Nils Pipenbrinck
A: 

You can inject events into an X11 window. I think xnee will do that for you. I think that "inspect" (using a feature of Tk?) used to do this as well.

ejgottl