ControlClick Up releases all buttons

Report problems with documented functionality
zebluk

ControlClick Up releases all buttons

23 May 2017, 00:52

Hi,

I noticed that when sending a ControlClick with U option (button UP), all other buttons got automatically released. A quick check at the source revealed this comes from this line (script2.cpp:2207)

Code: [Select all] [Download] GeSHi © Codebox Plus

PostMessage(control_window, msg_up, 0, lparam);


The wParam is forced to 0 hence releasing all the buttons. To fix it, simply replace the 0 with a wParam value that reflects the real states of the other buttons. Testing with pure window messages confirmed it's enough to make it work as expected.

Thanks
Vh_
Posts: 152
Joined: 17 Mar 2017, 22:06

Re: ControlClick Up releases all buttons

28 Jul 2017, 20:49

This would be a post message error, not ControlClick :)
guest3456
Posts: 2013
Joined: 09 Oct 2013, 10:31

Re: ControlClick Up releases all buttons

29 Jul 2017, 08:45

Vh_ wrote:This would be a post message error, not ControlClick :)

Uh. I don't think so.


zebluk wrote:

Code: [Select all] [Download] GeSHi © Codebox Plus

PostMessage(control_window, msg_up, 0, lparam);

The wParam is forced to 0 hence releasing all the buttons. To fix it, simply replace the 0 with a wParam value that reflects the real states of the other buttons. Testing with pure window messages confirmed it's enough to make it work as expected.

I've always used 0 also. ControlClick and the WM_ messages are used to virtually send the clicks, compared to regular Click which is more like a physical mouse action. How would you GET the states of the other buttons to know what to even pass? Would GetKeyState suffice? And if so, would you use the Logical or Physical state?

Lastly, I think this could be considered as something that would 'break' scripts so this would probably be in consideration for AHK v2

Vh_
Posts: 152
Joined: 17 Mar 2017, 22:06

Re: ControlClick Up releases all buttons

29 Jul 2017, 12:07

Can you provide an example? I tried something with ControlClick UP and it didnt interfere with other keys
guest3456
Posts: 2013
Joined: 09 Oct 2013, 10:31

Re: ControlClick Up releases all buttons

29 Jul 2017, 12:11

I haven't tested the original Bug Report so I don't know if in fact it is true or not


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 4 guests