Posts: 19
Threads: 10
Joined: Mar 2003
It’s easy enough to trigger a macro by pressing a mouse button and then lifting it. But can a macro be triggered immediately once the button is pressed?
Yes, this is a pretty fiddly difference. But I’ve gotten myself into trouble quite a few times with a macro which triggers when a button is lifted — Intuitively, I’m somehow expecting it to run when the button is pressed, instead.
9: ) Lindsey Dubb
Posts: 12,074
Threads: 141
Joined: Dec 2002
Assign a filter function that launches the macro using mac. Filter functions run on button down, because they must have a chance to eat the mouse message.
Every mouse-button macro that has this filter function runs on button down:
;/
function# iid FILTER&f
mac iid ;;run the macro now, not when button is released
ret -1 ;;eat the mouse message if Eat is checked
Posts: 19
Threads: 10
Joined: Mar 2003
Thanks — That works great! I wasn’t sure whether this was a Wish List or a programming question. Looks like it is, indeed, doable.
For anyone curious — I’ve got my mousewheel “button” mapped to perform a double click (except in Firefox). When the double click triggered on mouse button up, that would sometimes cause an unexpected drag rather than a double click if I had accidentally moved the mouse between pressing and releasing the button.
9: ) Lindsey Dubb
Posts: 19
Threads: 10
Joined: Mar 2003
I’ve noticed a small oddity with this — It results in the (desired) double click, but there’s apparently also a middle-click event. I’m not sure if the middle click isn’t being “eaten” by my macro, or if it’s the middle-button-up event which is being detected.
This is more of a quirk than a problem — most programs ignore middle clicks, anyhow. The one spot where it shows up is with Quick Macro’s own taskbar menu, where a middle click temporarily disables any macro triggers.
In case it’s relevant, the macro’s text is:
(yep, pretty simple)
and the trigger is the middle mouse button, with Gintaras’ suggested filter function. The “eat” checkbox for the macro is activated.
9: ) Lindsey Dubb
Posts: 12,074
Threads: 141
Joined: Dec 2002
Yes, WM_MBUTTONUP is posted. The double click is intercepted by the mouse hook and resets filtering of middle mouse button up message.
Posts: 1,271
Threads: 399
Joined: Mar 2003
double left sysmenu doesn't work for me, because it
gets eaten by left sysmenu.
how can i perform multi clicks like tripple left sysmenu ?