AutoHotkey Community

It is currently May 27th, 2012, 3:11 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Mouse stay
PostPosted: March 20th, 2010, 9:21 am 
I downloaded AH and I can seem to find a solution to a minor problem. Is it possible to have the mouse stay at the position after running a key? The issue Im having is if the mouse starts at the bottom left and the HK is set to click someing top right, when I move the mouse it returns to the old, bottom left position, can I make it stay and move from where the HK called the mouse to click/run?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2010, 7:06 pm 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
Show your code so it's easier to help you.
(use code tags)

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2010, 10:08 pm 
Code:
^q::
click ,l,795,53
return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2010, 1:13 am 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
You might have to also Move the Mouse there...
Code:
^q::
  MouseMove, (X:=795), (Y:=53), 0
  Click, L, X, Y
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2010, 1:59 am 
a_h_k wrote:
You might have to also Move the Mouse there...
Code:
^q::
  MouseMove, (X:=795), (Y:=53), 0
  Click, L, X, Y
Return

The mouse pointer already does move to that location. Then it stays, but when I go to move the mouse with my hand it returns to the last location rather then, moving from 795,53. Not the biggest issue, just an annoyance thought it could be fixed/done with a different code.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2010, 2:27 am 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
Not sure why that happens .. it doesn't on my pc. What app & OS are you using?

You could try this workaround...
Code:
^q::
  Click, L, (X:=795), (Y:=53)

  Loop  {
    MouseGetPos, X2, Y2
    If (X2!=X and Y2!=Y)
    {
      Sleep, 1000            ;Gives time for (?) to move mouse back to original location (reduce this value to the minimum required)
      MouseMove, X, Y, 0     ;Move mouse BACK to the new desired location (that Click'ed on)
      Return
    }
    Sleep, 100
  }
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2010, 3:22 am 
Im using win 7 and it does it in all programs. Thanks anyway for the help.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: rbrtryn, Yahoo [Bot] and 26 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group