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. Move and control Windows mouse cursor with Qt

Move and control Windows mouse cursor with Qt

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 4 Posters 3.7k Views
  • 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.
  • JulianJ Offline
    JulianJ Offline
    Julian
    wrote on last edited by
    #1

    Hello All.

    There is a library, class or method to control and manage the mouse cursor, the mouse pointer?

    I sends data through bluetooth and with that I want to control the mouse.

    Also, you can also help me with: What windows services control the mouse? Im really lost with it.
    Thanks in advance.

    JonBJ J.HilkJ 2 Replies Last reply
    0
    • JulianJ Julian

      Hello All.

      There is a library, class or method to control and manage the mouse cursor, the mouse pointer?

      I sends data through bluetooth and with that I want to control the mouse.

      Also, you can also help me with: What windows services control the mouse? Im really lost with it.
      Thanks in advance.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Julian
      Do you mean http://doc.qt.io/qt-5/qcursor.html ?

      1 Reply Last reply
      4
      • JulianJ Offline
        JulianJ Offline
        Julian
        wrote on last edited by
        #3

        Thanks jonB

        1 Reply Last reply
        0
        • JulianJ Julian

          Hello All.

          There is a library, class or method to control and manage the mouse cursor, the mouse pointer?

          I sends data through bluetooth and with that I want to control the mouse.

          Also, you can also help me with: What windows services control the mouse? Im really lost with it.
          Thanks in advance.

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @Julian
          afaik QCurser only works within your Qt-Application, if you want to controle the Mouse-Curser over all you will defenitly have to fall back to native os(windows?) functions/libaries.


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          1
          • JulianJ Offline
            JulianJ Offline
            Julian
            wrote on last edited by
            #5

            Hello J. Hilk.

            It's working with this code

             
                QScreen *screen=QGuiApplication::primaryScreen();
                QCursor *cursor= new QCursor();
                cursor->setPos(screen , x,y);
            // x and y are interger variable.
            

            And it change the cursor position in the screen. Now I've to enable clicking to complete control the mouse.

            Pablo J. RoginaP JonBJ 2 Replies Last reply
            0
            • JulianJ Julian

              Hello J. Hilk.

              It's working with this code

               
                  QScreen *screen=QGuiApplication::primaryScreen();
                  QCursor *cursor= new QCursor();
                  cursor->setPos(screen , x,y);
              // x and y are interger variable.
              

              And it change the cursor position in the screen. Now I've to enable clicking to complete control the mouse.

              Pablo J. RoginaP Offline
              Pablo J. RoginaP Offline
              Pablo J. Rogina
              wrote on last edited by
              #6

              @Julian when your issue is solved, please don't forget to mark your post as such! Thanks

              Upvote the answer(s) that helped you solve the issue
              Use "Topic Tools" button to mark your post as Solved
              Add screenshots via postimage.org
              Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • JulianJ Julian

                Hello J. Hilk.

                It's working with this code

                 
                    QScreen *screen=QGuiApplication::primaryScreen();
                    QCursor *cursor= new QCursor();
                    cursor->setPos(screen , x,y);
                // x and y are interger variable.
                

                And it change the cursor position in the screen. Now I've to enable clicking to complete control the mouse.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #7

                @Julian

                Now I've to enable clicking to complete control the mouse.

                Assuming you mean "clicking outside of your application"(?), I'm not sure the OS/window system/Qt will allow you to do that. (I see @J-Hilk has said that above.) If it can be done, you may need native OS/windows calls, "CaptureMouse", or similar...

                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