Automatic test of GUI?

I have a fullscreen application running on one machine A (PC with qnx).
Now I want remotely to enter UI commands (mouse movement, double clicks etc.) from another machine B (maybe not even with qnx) in a script.
The remote commands shall be reflected on the screen of A. ie the mouse movements shall be shown on A.
It shall also be possible from B to inquire data about the UI on A.
Before I start my open source project, I would like to here if something the like has already been made?
Are there any protocol I can use instead of inventing a new?
Any other comments are also appreciated.

If the other machine is QNX or windows, then you can use phditto/phindows for the remote connectivity. For recording the macros, someone wrote an “event recorder and playback” utility for photon once (it isn’t too hard). On Windows there are many automated UI test tools that can move the mouse and send a click, and once running phindows you can use any of these tools.