AutoHotkey Community

It is currently May 27th, 2012, 12:40 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: February 16th, 2010, 8:42 pm 
Offline

Joined: February 16th, 2007, 4:23 am
Posts: 15
Hi all, I've come across a hotkey i want to write but am not advanced enough to do it myself so i need your help!

Here is what i am trying to achieve.

When my left click mouse button is clicked, i want it to also execute the Q button(q button is pressed if left click mouse button is pressed)

also, if the left click mouse button is pressed down and held down over time, i want it to press the Q button in intervals of 500ms.

Can anyone help me get started? i think the first part will be easy, just have the hotkey be left click and if it is pushed then Q is pusshed, but have like a quarter second sleep after left click is pushed. But i dont know about the second thing i want?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2010, 8:50 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Code:
#SingleInstance, Force ; to force running of a new copy if another is already running
; prevents the msgbox "An older instance of this script is already running. 
;   Replace it with this instance?"

Lbutton::
Loop
{
  if not GetKeyState("Lbutton", "P")
  break
  Send {q}
  Sleep, 500
}
return

esc::exitapp   ; in case of emergency, hit escape


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2010, 9:07 pm 
Offline

Joined: February 16th, 2007, 4:23 am
Posts: 15
Leef_me wrote:
Code:
#SingleInstance, Force ; to force running of a new copy if another is already running
; prevents the msgbox "An older instance of this script is already running. 
;   Replace it with this instance?"

Lbutton::
Loop
{
  if not GetKeyState("Lbutton", "P")
  break
  Send {q}
  Sleep, 500
}
return

esc::exitapp   ; in case of emergency, hit escape


is there a way so that the left click button is still executed along with the Q button? the Q is replacing my left click


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 17th, 2010, 3:34 pm 
Offline

Joined: February 16th, 2007, 4:23 am
Posts: 15
bump


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 17th, 2010, 4:15 pm 
check modify keys for hotkeys
it is related to "~"


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2010, 3:06 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Yopy,

Just to clarify Guest's comment, you should look here for the answer

You can use the following modifier symbols to define hotkeys:
http://www.autohotkey.com/docs/Hotkeys.htm#Symbols


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: chaosad, jrav, Yahoo [Bot] and 22 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