Move and control Windows mouse cursor with Qt
-
wrote on 28 Nov 2018, 22:59 last edited by
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. -
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.wrote on 28 Nov 2018, 23:05 last edited by@Julian
Do you mean http://doc.qt.io/qt-5/qcursor.html ? -
wrote on 29 Nov 2018, 01:45 last edited by
Thanks jonB
-
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.@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. -
wrote on 29 Nov 2018, 12:43 last edited by
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.
-
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.
wrote on 29 Nov 2018, 14:16 last edited by@Julian when your issue is solved, please don't forget to mark your post as such! Thanks
-
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.
wrote on 29 Nov 2018, 15:08 last edited byNow 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...
2/7