Hotkey at specific coordinates Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
racer
Posts: 29
Joined: 07 May 2022, 15:02

Hotkey at specific coordinates

07 Apr 2023, 18:11

Hello guys
I would like to have a hotkey that does its job only at specific coordinates (area). Is it possible? Thanks
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Hotkey at specific coordinates

07 Apr 2023, 18:24

depends what the "job" is
User avatar
mikeyww
Posts: 27177
Joined: 09 Sep 2014, 18:38

Re: Hotkey at specific coordinates  Topic is solved

07 Apr 2023, 18:25

Code: Select all

#Requires AutoHotkey v1.1.33

#If inArea(250, 250, 500, 500)
F3::SoundBeep 1500
#If

inArea(x1, y1, x2, y2) {
 CoordMode Mouse
 MouseGetPos x, y
 ToolTip % "(" x ", " y ")"
 Return x >= x1 && x <= x2 && y >= y1 && y <= y2
}
racer
Posts: 29
Joined: 07 May 2022, 15:02

Re: Hotkey at specific coordinates

07 Apr 2023, 20:31

mikeyww wrote:
07 Apr 2023, 18:25

Code: Select all

#Requires AutoHotkey v1.1.33

#If inArea(250, 250, 500, 500)
F3::SoundBeep 1500
#If

inArea(x1, y1, x2, y2) {
 CoordMode Mouse
 MouseGetPos x, y
 ToolTip % "(" x ", " y ")"
 Return x >= x1 && x <= x2 && y >= y1 && y <= y2
}
Amazing :shock:
Thanks a lot man!
racer
Posts: 29
Joined: 07 May 2022, 15:02

Re: Hotkey at specific coordinates

11 Aug 2023, 14:00

Is it possible to make it work only in a specific program. e.g. Mozilla Firefox?
ntepa
Posts: 434
Joined: 19 Oct 2022, 20:52

Re: Hotkey at specific coordinates

11 Aug 2023, 15:22

racer wrote:
11 Aug 2023, 14:00
Is it possible to make it work only in a specific program. e.g. Mozilla Firefox?
Try this:

Code: Select all

#If WinActive("ahk_exe firefox.exe") && inArea(250, 250, 500, 500)
racer
Posts: 29
Joined: 07 May 2022, 15:02

Re: Hotkey at specific coordinates

12 Aug 2023, 10:34

ntepa wrote:
11 Aug 2023, 15:22
racer wrote:
11 Aug 2023, 14:00
Is it possible to make it work only in a specific program. e.g. Mozilla Firefox?
Try this:

Code: Select all

#If WinActive("ahk_exe firefox.exe") && inArea(250, 250, 500, 500)
Thank you :+1:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Rohwedder and 93 guests