Quote:
Originally Posted by PoP
You got it. My 5 way moves the character cursor too, as expected. I want to also move the mouse pointer.
|
this thread - obliquely - discusses the issue
http://osdir.com/ml/emulators.qemu/2.../msg00085.html
http://osdir.com/ml/emulators.qemu/2.../msg00093.html
etc..
other thoughts:
http://stackoverflow.com/questions/3...ordinates-in-x
get cursor position
Code:
#include <X11/Xlib.h>
#include <assert.h>
#include <unistd.h>
#include <stdio.h>
#include <malloc.h>
static int _XlibErrorHandler(Display *display, XErrorEvent *event) {
fprintf(stderr, "An error occured detecting the mouse position\n");
return True;
}
int main(void) {
int number_of_screens;
int i;
Bool result;
Window *root_windows;
Window window_returned;
int root_x, root_y;
int win_x, win_y;
unsigned int mask_return;
Display *display = XOpenDisplay(NULL);
assert(display);
XSetErrorHandler(_XlibErrorHandler);
number_of_screens = XScreenCount(display);
fprintf(stderr, "There are %d screens available in this X session\n", number_of_screens);
root_windows = malloc(sizeof(Window) * number_of_screens);
for (i = 0; i < number_of_screens; i++) {
root_windows[i] = XRootWindow(display, i);
}
for (i = 0; i < number_of_screens; i++) {
result = XQueryPointer(display, root_windows[i], &window_returned,
&window_returned, &root_x, &root_y, &win_x, &win_y,
&mask_return);
if (result == True) {
break;
}
}
if (result != True) {
fprintf(stderr, "No mouse found.\n");
return -1;
}
printf("Mouse is at (%d,%d)\n", root_x, root_y);
free(root_windows);
return 0;
}
So...
XQueryPointer(display, root_windows[0], &window_returned,
&window_returned, &root_x, &root_y, &win_x, &win_y,
&mask_return);
perhaps that could be "massaged"
Setting x y
Quote:
..., a flexible X-automation tool is xte, part of the xautomation package. Use xte -h to see a list of the X events it supports. This example goes to a point 320 pixels from the left edge of the screen and 50 pixels down and then fakes a click there with button 1:
xte 'mousemove 320 50' 'mousedown 1'
'mouseup 1'
The mousedown and mouseup events are separate, so you can drag as well as click.
|
also
http://www.slack.com/sw/xwit-man.html
and
http://tronche.com/gui/x/xlib/input/XWarpPointer.html
xdotool may also be useful (This I have)
HTH. no answers, but thoughts in a direction