I'm trying to create a hotkey for a software button inside a program since the devs of the program did not do so.

Here is what I tried to move the mouse, click the button and move the mouse back to the original position:

CoordMode, ToolTip, Screen
MouseGetPos, X, Y
Click 512, 516
MouseMove, %X%, %Y%

This works, on say the desktop, but when the program window is active, nothing happens. Is there some way to make this work inside the program window?

  • You could ask this question on stackoverflow, it has a larger community, more programming experts than here, and there is an autohotkeys tag on stackoverflow too. You could also try on the autohotkeys forum autohotkey.com/boards But do add the answer here if you find one elsewhere. – barlop Jul 31 '17 at 14:22
  • Which program are you using this in? Does it run windowed or fullscreen? – Silas B Jul 31 '17 at 20:26
  • Hi, it runs windowed. It's this scientific tool to clean and analyze physiological data called BPV. – Arkansin Jul 31 '17 at 21:25

The CoordMode command may need to be set for the mouse, not for ToolTip. Set it for whichever mode your coordinates are relative to (screen, window, client, etc.--see documentation)

You may also want to add an #IfWinActive statement to limit scope on the shortcut key binding by making it only work when a window from the desired executable is active, i.e., #IfWInActive ahk_exe BPV.exe or whatever your program is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.