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.
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.