> Could be that this is possible.
But you have to ask the experts for X11 on how to do it.
This group deals with Standard C++ only. Standard C++ doesn't have
a screen or a mouse or X11 or something like that.
I will say it would bee better to ask this in comp.os.linux.x but
I do happen to know.
I am writing a class to do just this it is already capable of all
the things you want to do. I have two even. One uses the XTrap
extention the other uses XTest. I can email you the source code if
you want it. The code can also record input to a macro language.
To use the XTrap class you must have the line 'Load "xtrap"' in
the module section of your XF86Config-4 file and have the extention
compiled and installed. It comes with XFree86 and is compiled if
it is not disabled.
here is example code for using the class:
#include "send_event2.hh "
int main() {
X11_Send_Events hi;
hi.set_window(" Mozilla Firebird"); // Sets the Curent window to the a window matching
// string. Returns zero on fail.
hi.set_default_ window_position (0, 24); // exactly what it says... :-) X, Y.
hi.window_to_fr ont(); // Brings the window to the front and to the default
sleep(1); // position.
hi.button_toggl e(3); // Toggles the mouse button of choise 1-5.
sleep(1);
hi.button_toggl e(3);
sleep(1);
hi.button_click (1); // Clicks the mouse button of choise 1-5.
sleep(1);
hi.move_mouse(1 00, 200); // Move mouse x and y pixels.
sleep(1);
hi.move_mouse_a bsolute_window( 200, 35); // Move mouse to asolute position from corner of
sleep(1); // selected window. Uses top left corner.
hi.move_mouse_a bsolute_screen( 400, 300); // Move mouse to absolute postion from top left
sleep(1); // corner of screen.
hi.center_mouse _pointer_in_win dow(); // Centers the mouse pointer in the current window.
sleep(1);
hi.record_input _to_ostream (std::fstream*) ;// You must send the program a signal to get it
// to exit from this loop.
return 0;
}
--
Want to email me? remove both dashes from the email address.