My data comes from an arduino (which gets it from a sensor).
I'd like to have the data processed by an user program (after reading it from /dev/ttyUSB0 ).
After that I need to control the mouse cursor using the output of the program.
(I'd really like to avoid writing a kernel driver at this moment.)
What is the recommended way to do this(on a Linux environment)?
Perhaps a library on top of X...or some tool/script I can directly pipe the data into?
Taken from dzone:
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
void mouseMove(int x, int y)
{
Display *displayMain = XOpenDisplay(NULL);
if(displayMain == NULL)
{
fprintf(stderr, "Errore nell'apertura del Display !!!\n");
exit(EXIT_FAILURE);
}
XWarpPointer(displayMain, None, None, 0, 0, 0, 0, x, y);
XCloseDisplay(displayMain);
}
There are a few options I know of:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With