I would like to write a simple C++ program for Linux (Ubuntu) to control other GUI programs. For example, to be able to read text labels and put text into entry boxes of other programs written using gtkmm. I have looked at X11 but I don't seem to find a开发者_运维技巧ny relevant information or examples.
Thank you very much for any information.
One way of doing it is via the XTEST
(pdf) extension.
An example usage for key events is here: X11 Fake Key Event Generation using XTest Extension.
There is a Java Robot class that was designed for this purpose. It can generate mouse & keyboard events etcetera. There is a good documentation and a lot of examples. For example - Introduction to the Java Robot class in Java. Unfortunately, it is Java. You can use X11 API directly, but that is usually too hard.
精彩评论