-
October 26th, 2007, 12:17 AM
#1
How to set mouse position in linux,mac
Hi,
To set the mouse position in windows
POINT pt;
pt.x=pt.y=100;
ClientToScreen(GetActiveWindow(),&pt);
SetCursorPos(pt.x,pt.y);
here we need to change client coordinates to screen coordinates
To get the mouse position in windows
GetCursorPos(&pt);
ScreenToClient(GetActiveWindow(),&pt);// to get the coordinate for current window
But i dont have any idea how to do the same for MAC/Linux/OS2 opereating systems
please tell how to do this for other OS
-
October 26th, 2007, 07:42 AM
#2
Re: How to set mouse position in linux,mac
Originally Posted by MFCQuery
But i dont have any idea how to do the same for MAC/Linux/OS2 opereating systems
please tell how to do this for other OS
You mentioned 3 different operating systems with different ways of doing these things.
Why not do a google search for the information?
Regards,
Paul McKenzie
-
October 26th, 2007, 08:31 AM
#3
Re: How to set mouse position in linux,mac
I think it´s impossible when using the native OS SDK because there are different APIs. If you want to target multiple platforms you have to use a toolkit that is available for all target platforms. wxWidgets or Trolltech´s Qt may be what you are looking for.
- Guido
-
October 26th, 2007, 02:50 PM
#4
Re: How to set mouse position in linux,mac
It's also probably worth noting that programmatically moving the cursor is against Apple's user interface guidelines, and they may not provide a documented function to do this in their APIs.
- Alon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|