Search code examples
c++linuxcursor-position

C++ - Cursor movement on linux


I try to move the cursor depending on hand position. I find some examples, but they don't standart library. How can I set cursor position using C++ on linux?


Solution

  • The answer from Basile Starynkevitch is the way to go if you are advanced enough in C++ to be able to work with the frameworks - however, there is a X11 automation tool called xdotool that you can to perform the mouse movements. You can either use it or look in the sources how they implement the communication with X11. Still, I'm not sure if all Linux distributions have this package and how broadly it is supported.