Release a mouse button?

Get help with using AutoHotkey and its commands and hotkeys
Posts: 34
Joined: 11 Aug 2016, 11:31

Release a mouse button?

05 Oct 2016, 22:07

I'm capturing mouse clicks via hotkey(s) like this:

Code: Select all

#IfWinActive, ahk_class ThunderRT6FormDC
and I'm checking in the Mouse_ProcessClick() function which mouse button was used and depending on if it is a single click, a long click (while moving the mouse), a long click (while not moving the mouse) or a double click and additionally which keyboard modifier was used.

Each different click type can lead to a different action that is performed afterwards!

I logically press the captured mouse button + it's keyboard modifier and in most cases send a script to XYplorer (a file manager) via WM_COPYDATA afterwards.

My problem: While the WM_COPYDATA script sending is in process, I can't logically release the mouse button in the Mouse_ProcessClick() function any more so
XYplorer e.g. displays an (internal) menu on the screen as a result of the script sent via WM_COPYDATA but the mouse button isn't released yet inside my AHK script and therefore I can't
click on any of these menu items.

But I can't release the mouse button before I invoke the WM_COPYDATA send because for a right click XYplorer would immediately display the normal shell context menu instead of the menu
that the script should display instead.

Is there a way to logically release a mouse button inside a function without triggering a "physical" action to work around this problem?

I was using a timer before instead of hotkeys where I didn't had this problem but capturing fast double clicks (which can execute a WM_COPYDATA send as well) doesn't really work well with timers...

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Dinarid, JoeWinograd, mikeyww, ToJaRedi and 51 guests