Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT Mouse Event outside Window/Widget
Forum Updated to NodeBB v4.3 + New Features

QT Mouse Event outside Window/Widget

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    digimonkey
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • IamSumitI Offline
      IamSumitI Offline
      IamSumit
      wrote on last edited by
      #2

      Hi.
      No..There is no equivalent API.
      but .. You can use the above code in Qt .

      Qt does not provide such events that can be post outside the QWidget.

      Be Cute

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved