sebastian___
Joined: 05 Oct 2007 Posts: 15
|
Posted: Sat Dec 01, 2007 9:09 am Post subject: after MouseClick, return mouse at previous position |
|
|
I'm using this script with a 3d software. Basically with Alt + MButton I rotate the image. So instead of pressing with the mouse, a button on the interface the script press it for me... but everytime, the mouse is moved on the side of the screen where the interface button is located. That's fine and normal.
But is it possible to move the mouse back where it was before I was using the hotkey ?
This is the current code.
| Code: | !MButton::
MouseClick , Left, 1115, 462, , 0, D
KeyWait MButton
MouseClick , Left, , , , 0, U
return |
And I think I should add maybe something like :
Get Mouse position before executing the whole thing
Memorize it
After Mouse Up event - restore the memorized position
Edit : - This sometimes works and returns the mouse where it was, and sometimes not.
| Code: | !MButton::
MouseGetPos, xpos, ypos
MouseClick , Left, 1115, 462, , 0, D
KeyWait MButton
MouseClick , Left, , , , 0, U
MouseMove, xpos, ypos , 1
return |
|
|