Binding on AutoHotkey isn't working?

0

I'm new to AHK and I'm trying to write a script which does the following:

I press F3 and then there is a mouse click at certain coordinates on the screen and then the cursor goes back into its original position, so it doesn't look like the script caused the cursor to move at all. I'm basically trying to create a hotkey for a button on screen because the developers of the software did not add this functionality to the app.

This is what I have so far:

#F3::
CoordMode, ToolTip, Screen
MouseGetPos, X, Y
Click 512, 516
MouseMove, %X%, %Y%
Return

However, when I now press F3, nothing happens. I have tried removing the key binding and the Return command so that double-clicking the script just does what pressing F3 should do and it works perfectly. Any help as to what I'm doing wrong?

Arkansin

Posted 2017-07-29T22:12:13.673

Reputation: 3

Answers

1

By adding the #, you've accidentally bound this to Win+F3. Remove the #, and you should be good to go.

Silas B

Posted 2017-07-29T22:12:13.673

Reputation: 330

That did fix the problem of the action not happening. However, it still doesn't seem to work when the window of the app is active, which makes it pretty useless. Any way to make it work in the program? – Arkansin – 2017-07-31T03:56:04.280

No, Arkansin! Don't do it! Don't take a correct answer to this core question (why the binding isn't working) and fail to accept the answer, and then ask a separate question in the comments. Silas B did his job right, of providing the right answer. Don't try to make him work further before giving him due credit. First, accept his answer. Then, if you want more detail in a way that is really a different question, just make a new question on the site. (If you want, you can message Silas B to point Silas B to the new question.) – TOOGAM – 2017-07-31T06:16:27.597

Thanks so much Toogam for an irrelevant and unnecessary comment. FYI I was going to choose Silas B's answer as the correct answer anyway, but waited for the further clarification for two reasons:

  1. So that if the question remains unanswered, someone else could come in, see my comment and potentially comment something helpful (in case this is a minor problem) and that would be the end of the issue. If I close this question as answered, the number of people who might see it will fall drastically.
  2. If you notice, my question specifically talks about hotkeys in an app. Silas B's answer,...
  3. < – Arkansin – 2017-07-31T07:52:32.107

while helpful, is not the complete answer since my issue still persists. But yeah, thanks for swooping in. SIGH – Arkansin – 2017-07-31T08:03:54.457