Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Set mouse position
Set mouse position [message #54339] Fri, 26 June 2020 00:22 Go to next message
raylan is currently offline  raylan
Messages: 1
Registered: June 2020
Junior Member
How to set the mouse position inside the window using u++?
Re: Set mouse position [message #54340 is a reply to message #54339] Fri, 26 June 2020 18:15 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello Raylan,

From my knowledge,
if you want to set the cursor / mouse position you must use the OS api :

for windows :
https://docs.microsoft.com/en-us/windows/win32/api/winuser/n f-winuser-setcursorpos

Here you have one exemple (I use it to center mouse cursor on middle of my windows at every draw loop)
    SetCursorPos(topWindow->GetPos().x.GetA() + (GetSize().cx/2) +1,topWindow->GetPos().y.GetA() + (GetSize().cy/2)+1 );

Don't forget to include <Winuser.h>

For linux : I have no idea, maybe a quick google search will awnser your question



Re: Set mouse position [message #54341 is a reply to message #54340] Fri, 26 June 2020 23:40 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Raylan

You can also check in package Bazaar/SysInfo, function Mouse_SetPos().
It works in Windows and Linux.


Best regards
IƱaki
Previous Topic: Eigen updated
Next Topic: SSH Exec output truncated
Goto Forum:
  


Current Time: Thu Mar 28 19:32:06 CET 2024

Total time taken to generate the page: 0.01430 seconds