[a112] ControlClick position mode requires "pos"

Discuss the future of the AutoHotkey language
Posts: 7
Joined: 20 Jun 2020, 06:18

[a112] ControlClick position mode requires "pos"

20 Jun 2020, 06:40

Hi all,

In {a112] this doesn't work:

Code: Select all

run "notepad"
winwait "ahk_exe notepad.exe"
controlclick "x60 y70", "ahk_exe notepad.exe"
A dialog box says that a control named "x60 y70" is not found.
It works only if the "pos" option in controlclick's 6th parameter is used. This is a (undocumented?) change in the behavior of controlclick - previously, if a control "x60 y70" was not found it would interpret "x60 y70" as coordinates. It also contradicts the documentation, which implies that the "pos" option in controlclick's 6th parameter is needed only if there's a control "x60 y70". It also contradicts the statement in the documentation that an exception is thrown if "The target control could not be found and Control-or-Pos does not specify a valid position." The actual behavior is - an exception is thrown if the target control could not be found, EVEN IF Control-or-Pos DOES specify a valid position, since (in a change from previous versions) if the target control "x60 y70" could not be found AHK does not try interpreting "x60 y70" as coordinates but instead throws (unless "pos" is used in controlclick's 6th parameter). Also, the documentation gives an example:

Code: Select all

ControlClick "x55 y77", WinTitle  ; Clicks at a set of coordinates. Note the lack of a comma between X and Y.
which actually throws since no control "x55 y77" is found.

Is this a bug or am I misunderstanding?
Posts: 6984
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: [a112] ControlClick position mode requires "pos"

21 Jun 2020, 00:13

It's a bug.

[Edit: Commit 694fbe1a should fix it.]

I would like to understand why you (and others) chose to post in the "v2 Development" forum. :?:
Ask For Help
Get help with using AutoHotkey and its commands and hotkeys
Subforums: Gaming, AutoHotkey v2 Help
Bug Reports
Report problems with documented functionality
AutoHotkey v2 Development
Discuss the future of the AutoHotkey language
It seems like the least suitable match for your query.

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 2 guests