QT Mouse Event outside Window/Widget
Hi,
Im trying to make my mouse click in some screen coordinates when my program receives a trigger for do it.
Ive made it in C++ before, now Im trying to make it in Qt, heres a small example of what i mean.
Code:
C++ code
if (bin_trigger == 1)
{
SetCursorPos(screenXpos, screenYpos);
ZeroMemory(Input, sizeof(INPUT)* 2);
Input[0].type = INPUT_MOUSE;
Input[0].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
Input[1].type = INPUT_MOUSE;
Input[1].mi.dwFlags = MOUSEEVENTF_LEFTUP;
SendInput(2, Input, sizeof(INPUT));
}
I would be happy to get some tips or some pseudo-code from someone who have made somthing similar.
Thank you in advance.
Re: QT Mouse Event outside Window/Widget
Qt is as C++ library so your application is still a C++ application.
Why don't you just use the code that you know to work?
Cheers,
_
Re: QT Mouse Event outside Window/Widget
There could be some kind of function already implemented in QT that I didnt knew. Thank you I will try to implement it with what i have.