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 

Move curser, then go back to initial pos

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



Joined: 16 Sep 2006
Posts: 25

PostPosted: Sun Jul 27, 2008 5:26 pm    Post subject: Move curser, then go back to initial pos Reply with quote

Is it possible to make a hotkey that first clicks on a certain mousepos then go back to the initial possision of the curser?
Back to top
View user's profile Send private message
vahju



Joined: 17 Feb 2008
Posts: 97

PostPosted: Sun Jul 27, 2008 5:34 pm    Post subject: Reply with quote

Look up the following in ahk help:

MouseGetPos
MouseClick
Back to top
View user's profile Send private message
fenix



Joined: 16 Sep 2006
Posts: 25

PostPosted: Sun Sep 07, 2008 12:00 am    Post subject: Reply with quote

Havnt been able to figure anything out, can anyone help me out please?
Back to top
View user's profile Send private message
Slanter



Joined: 28 May 2008
Posts: 397
Location: Minnesota, USA

PostPosted: Sun Sep 07, 2008 12:06 am    Post subject: Reply with quote

Code:
#x::
   CoordMode, Mouse, Screen
   MouseGetPos, X, Y
   MouseClick,, 50, 50
   MouseMove, %X%, %Y%, 0
Return

Question
_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message Visit poster's website
fenix



Joined: 16 Sep 2006
Posts: 25

PostPosted: Sun Sep 07, 2008 12:30 am    Post subject: Reply with quote

x::
CoordMode, Mouse, Screen
MouseGetPos, X, Y

MouseMove, 853, 992
Click, left
MouseMove, 455, 957
Click, left
return

MouseMove, %X%, %Y%, 0
Return


Thats kinda what I want, I want it to save the initial coordinates.
then click a specfic coordinate, and go back to the inital coordinates. it doesnt seem to work with what I made there. whats wrong?

Thanks in advance !
Back to top
View user's profile Send private message
Serenity



Joined: 07 Nov 2004
Posts: 1276

PostPosted: Sun Sep 07, 2008 1:12 am    Post subject: Reply with quote

Try removing the first Return so the last MouseMove can execute:

Code:
x::
CoordMode, Mouse, Screen
MouseGetPos, X, Y

MouseMove, 853, 992
Click, left
MouseMove, 455, 957
Click, left
return

MouseMove, %X%, %Y%, 0
Return

_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
fenix



Joined: 16 Sep 2006
Posts: 25

PostPosted: Sun Sep 07, 2008 1:23 am    Post subject: Reply with quote

Thanks much!
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