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.
  • J Offline
    J Offline
    Julian
    wrote on 28 Nov 2018, 22:59 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.

    J J 2 Replies Last reply 28 Nov 2018, 23:05
    0
    • J Julian
      28 Nov 2018, 22:59

      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 Offline
      J Offline
      JonB
      wrote on 28 Nov 2018, 23:05 last edited by
      #2

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

      1 Reply Last reply
      4
      • J Offline
        J Offline
        Julian
        wrote on 29 Nov 2018, 01:45 last edited by
        #3

        Thanks jonB

        1 Reply Last reply
        0
        • J Julian
          28 Nov 2018, 22:59

          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 Offline
          J Offline
          J.Hilk
          Moderators
          wrote on 29 Nov 2018, 05:52 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
          • J Offline
            J Offline
            Julian
            wrote on 29 Nov 2018, 12:43 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.

            P J 2 Replies Last reply 29 Nov 2018, 14:16
            0
            • J Julian
              29 Nov 2018, 12:43

              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.

              P Offline
              P Offline
              Pablo J. Rogina
              wrote on 29 Nov 2018, 14:16 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
              • J Julian
                29 Nov 2018, 12:43

                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.

                J Offline
                J Offline
                JonB
                wrote on 29 Nov 2018, 15:08 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

                2/7

                28 Nov 2018, 23:05

                topic:navigator.unread, 5
                • Login

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