Question

I'm looking for a solution on how to detect a mouse click in a specified area of window when using AutoHotkey. Let's say I would like to detect click in the area of coordinates x 100 y100, x120 y120. Any ideas or solutions would be highly appreciated, thank you!

edit 2: I just answered this question with a working code below.

Was it helpful?

Solution

The following code worked for me correctly:

~LButton::
MouseGetPos, x,y
if (x > 800 and x < 1500  and y < 600 and y > 200)
    MouseMove, 1000, 400
return

where 800, 1500, 600 and 200 are boundaries of desired area. If clicked inside it, the cursor will be moved out to a position 1000, 400.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top