V2 ...116... Click does not work Topic is solved

Get help for the alpha version of AutoHotkey v2 here. Please state the v2 version you are working with in the title when making a new topic.
HugoM
Posts: 18
Joined: 06 Mar 2018, 14:21

V2 ...116... Click does not work

13 Jul 2020, 13:03

Here my test script:

Code: Select all

^n::  ; Ctrl+N
{
    if WinExist("Untitled - Notepad")
        WinActivate
    else
	{
        Run "Notepad"
		Sleep 1000
		Send "ABC`nDEF"
		Sleep 100
	}
}
^c::
{
	Click
	Click
}
^m::
{
	MouseClick
	MouseClick
}
^r:: ; Restart script
{
	Reload
}
^v:: ; Version usw anzeigen
{
	Msgbox "A_AhkVersion " A_AhkVersion
}
[Mod edit: [code][/code] tags added.]

I hope it is self-explanatory.

My problem: 2 Click do nothing, 2 MouseClick mark "DEF"
Is it an issue of my german windows version (10 / 1909) or keyboard?
Up to ...115.. my original script worked (and this test of couse)

Help appreciated
(Sorry about my "German-English")
swagfag
Posts: 4126
Joined: 11 Jan 2017, 17:59

Re: V2 ...116... Click does not work

13 Jul 2020, 14:17

in the case of the naked click:
probably a regression caused by https://github.com/Lexikos/AutoHotkey_L/commit/237845eea3db8eeff05a1a96e237459789e7c565#diff-a1b0769d26a5df9bf5730e45463ea956L2211
  • aVK is VK_LBUTTON_LOGICAL
  • the if statement used to be responsible for setting aVK to VK_LBUTTON. now it no longer does
  • the switch directly below used to be responsible for setting the uninitialized event_down and event_up. now it no longer does, since there isnt a case to handle aVK = VK_LBUTTON_LOGICAL
  • calls to MouseEvent further below use unitialized variables, invoking undefined behavior

the naked mouseclick seems to work fine
HugoM
Posts: 18
Joined: 06 Mar 2018, 14:21

Re: V2 ...116... Click does not work

13 Jul 2020, 16:25

swagfag wrote:
13 Jul 2020, 14:17
in the case of the naked click:
probably a regression caused by https://github.com/Lexikos/AutoHotkey_L/commit/237845eea3db8eeff05a1a96e237459789e7c565#diff-a1b0769d26a5df9bf5730e45463ea956L2211
the naked mouseclick seems to work fine
So I understand that it is nothing wrong at me / my script / my windows / my keyboard but with the interpreter?
regards HugoM
swagfag
Posts: 4126
Joined: 11 Jan 2017, 17:59

Re: V2 ...116... Click does not work

13 Jul 2020, 17:36

wait until its fixed or use MouseClick / Click('Left') in the interim
lexikos
Posts: 7144
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: V2 ...116... Click does not work  Topic is solved

13 Jul 2020, 17:45

I meant to remove the fake VK_*BUTTON_LOGICAL constants, but obviously forgot. VK_LBUTTON is always logical, but the original code for MouseClick translated VK_LBUTTON to MOUSEEVENTF_LEFTDOWN/UP, which is illogical. (That is to say, Microsoft designed it to generate VK_RBUTTON if the user has swapped buttons, instead of always generating VK_LBUTTON like any sane developer would expect.)

Fixed by 4b11d72f.

Return to “AutoHotkey v2 Help”

Who is online

Users browsing this forum: No registered users and 4 guests