AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

after MouseClick, return mouse at previous position

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
sebastian___



Joined: 05 Oct 2007
Posts: 15

PostPosted: Sat Dec 01, 2007 9:09 am    Post subject: after MouseClick, return mouse at previous position Reply with quote

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

Smile

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   
Back to top
View user's profile Send private message
sebastian___



Joined: 05 Oct 2007
Posts: 15

PostPosted: Tue Dec 11, 2007 3:00 pm    Post subject: Reply with quote

Is there a better way for this ? Returning the mouse where it was ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group