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?

1

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

  • 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 Jul 31 '17 at 3:56
  • 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 Jul 31 '17 at 6:16
  • 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,... – Arkansin Jul 31 '17 at 7:52
  • while helpful, is not the complete answer since my issue still persists. But yeah, thanks for swooping in. SIGH – Arkansin Jul 31 '17 at 8:03

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.