I don't know library to hook. Please converse this code to jna code. How can I get the current mouse (pointer) position co-ordinates in X
Asked
Active
Viewed 878 times
1 Answers
1
Java provides a method to obtain mouse coordinates. If your JVM version does not support this method, then you need to open the X11 display, start an event loop, and listen for mouse motion events.
Display* dpy = XOpenDisplay(NULL);
XEvent ev;
XMaskEvent(dpy, PointerMotionMask, &ev);
The platform.jar library included with JNA includes a number of X11 library mappings and constants which should help.

technomage
- 9,861
- 2
- 26
- 40