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. Handle mouse event
Forum Updated to NodeBB v4.3 + New Features

Handle mouse event

Scheduled Pinned Locked Moved General and Desktop
7 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.
  • A Offline
    A Offline
    anmol2701
    wrote on last edited by
    #1

    Hi!

    I want to detect mouse event in my application run in backend.
    or
    If the user is working with another application in the meantime i want to detect events in my application.

    Any guide or link?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      AFAIK, you cannot do this using Qt. You'll have to rely on system calls (mouse hooks, etc.) for that.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        anmol2701
        wrote on last edited by
        #3

        Thanks for reply!

        Could you please refer any link or example of mouse hooks to understand the whole concept..

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Asperamanca
          wrote on last edited by
          #4

          Which operating system?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            anmol2701
            wrote on last edited by
            #5

            Linux (Ubuntu 12.04)

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Asperamanca
              wrote on last edited by
              #6

              Sorry, I don't know the APIs on Linux. Hopefully, someone else can help.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                anmol2701
                wrote on last edited by
                #7

                I tried this:

                After Find the QPoint point = QCursor::pos() after every second using Qtimer and match it with the last point.

                Using this i am able to detect mouse position and find user idle or not.

                *But mouse click is not working.

                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