iamde
iamde

Reputation: 13

How to bind a mouse to a key in AHK language?

I am new to ahk. I know how to bind a key to a key (a::b), but is it possible to bind a key to a mouse click?

Upvotes: 1

Views: 303

Answers (2)

user6465079
user6465079

Reputation:

It depends on key you want to bind. You can use

a::Click    ; for most of the keys
`;::Click   ; escaping special characters such as ";" is required

Upvotes: 0

sixtytrees
sixtytrees

Reputation: 1233

There are several ways. For example:

g::click

or

h::mouseclick

If you want to do additional stuff when mouse is pressed down you can do this

d::
Click down  
MsgBox You pressed down d.
KeyWait, d 
Click up
MsgBox You released d.
return

Upvotes: 1

Related Questions