Hi,I see there is a wxGetMousePosition function to get the mouse's position,Is there a wxSetMousePosition to move the mouse to the appointed position?
Thanks
Set Mouse Position
-
- Knows some wx things
- Posts: 38
- Joined: Thu Jun 09, 2005 1:44 am
- Location: china
-
- Filthy Rich wx Solver
- Posts: 203
- Joined: Tue Aug 31, 2004 7:06 pm
- Location: Behind a can of Mountain Dew
- Contact:
Use wxWindow::WarpPointer. Note, you can't do this on Mac because, as the documentation says: "Apple Human Interface Guidelines forbid moving the mouse cursor programmatically".
-
- Knows some wx things
- Posts: 38
- Joined: Thu Jun 09, 2005 1:44 am
- Location: china
-
- Filthy Rich wx Solver
- Posts: 203
- Joined: Tue Aug 31, 2004 7:06 pm
- Location: Behind a can of Mountain Dew
- Contact:
You could fake motion just fine. Technically, the windowing environment just adds the mouse motion vector to the current mouse position rapidly to simulate motion and you could do the same (wxIdleEvent may be a starting point for this) although the user could "fight" you over the position which would look odd (it'd flicker back and forth) but I'm not aware of the ability to simulate clicks of any sort. I'd suggest looking up the relevant Win32 API calls if you what to pull of what you are saying (if anyone else out there in the forumn knows of a way to do this with just wxWidgets, feel free to share).
Hi!
Technically this is possible. The problem is that you'll have to device your own way to do that for each platform. Moving the mouse can be done, as eco said, by using WarpPointer().
For virtually clicking the mouse wxWidgets offers no way to do that. On Windows you can do that by either using the old mouse_event() function, or the newer SendInput(). I'm not sure how other platforms handle this or if it is even possible.
Technically this is possible. The problem is that you'll have to device your own way to do that for each platform. Moving the mouse can be done, as eco said, by using WarpPointer().
For virtually clicking the mouse wxWidgets offers no way to do that. On Windows you can do that by either using the old mouse_event() function, or the newer SendInput(). I'm not sure how other platforms handle this or if it is even possible.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda