Post backdated by a year to keep it off the front page. Don’t know of any other way.
Updates: See End of Post
Building a Qt application that spawns another app and then clicks on it – the top window I think. Got it working on Windows with SendInput.
Now for the same idea on Linux. I’m trying to use X11. Found lots of examples using XQueryPointer and XSendEvent. Odd loop looking through windows and subwindows I have no clue about. Anyway, it doesn’t work and I have no idea which window the code is trying to target. Nobody talks about that in the examples.
Code runs, checks for errors and finds none. But clicks do not work. My click on mouse works instantly.
How do I figure out where clicks are going? And how do I find the top window or whatever I need to send clicks there?
Here’s the debug output of the app:
Here are the routines called by the Qt application from TimerEvents inside the QtWidget application. Here is the code over on GitHub.
Let’s try it as a Gist. Whooo hoooo…..
Super that works too. Who knew.
Ok, so how do I figure out what’s wrong here so my code can click’ity click click on other applications?
Tried Keypress events rather than mouse clicks and used XGetInputFocus to find the window. No success. Here is the github page for latest code: