Sending keystrokes from C program to certain running applications
My requirement is to save files before shutting the Linux machine down, unattended ie: when the user is not near the machine. This is done whenever the UPS battery is about to die, so that the files get saved. open-Office/text-editor applications that can be saved using keystrokes will have to be found from the running processes and keystrokes should be sent to them from a C program that was started in non-graphics stage. ie: from a C program that forks into memory as a daemon before xwindows part starts.
How to I send keystrokes to a running application? (like cotrol + F and then wait and then send next set of keystrokes till the file is saved
as a new file or as the same file itself), either from C program or a script?
|