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.

Qt Code:
  1. C++ code
  2.  
  3. if (bin_trigger == 1)
  4. {
  5. SetCursorPos(screenXpos, screenYpos);
  6. ZeroMemory(Input, sizeof(INPUT)* 2);
  7. Input[0].type = INPUT_MOUSE;
  8. Input[0].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
  9. Input[1].type = INPUT_MOUSE;
  10. Input[1].mi.dwFlags = MOUSEEVENTF_LEFTUP;
  11. SendInput(2, Input, sizeof(INPUT));
  12. }
To copy to clipboard, switch view to plain text mode 

I would be happy to get some tips or some pseudo-code from someone who have made somthing similar.

Thank you in advance.