Trigger only if right mouse button is down for AT LEAST x time?

so in a design app i use, i want to macro the actions of:

"press e"
"hold left click"
(and at the end:)
"release left click"
"press a"

by doing "hold right click" and "release right click". so holding it triggers the first half mentioned above, and releasing finishes the rest.

few issues:
essentially this action is for erasing objects - so ideally i hold down right click and move around erasing.

BUT

  1. right click is still triggering the context menu (on key down) so it throws off my macro.

  2. my macro triggers even by a single short right click - so i need it to trigger only for right click down longer than x amount of time - say 0.2s, to still allow for regular right click behavior.

  3. also - the macro needs to hold down left click but i think im not doing it right - the location of holding it is set to the mouse location - but does that even work if i move the mouse? if not then how do i simulate a left click down as i move the mouse around?

Any solution that anyone provides you may be app-specific. You haven't named the app you are using, so it may be difficult for anyone to give you a solution that works for all possible apps.

Keyboard Maestro does not have any triggers for mouse clicks. It does have a trigger called USB Device Key which can potentially trigger on a mouse click, but the problem with that trigger is that it doesn't "consume" the mouse click which means it's not "intercepting" the click, but rather it allows you to take an ADDITIONAL action in addition to the REGULAR mouse click action. I don't think that's what you want at all.

That's what I'm trying to explain. Keyboard Maestro cannot intercept mouse clicks, it can only do additional actions for mouse clicks.

You should probably show your macro. I'm guessing that you are using the USB Device Key trigger. That would be part of your problem.

At one time in the past I tried to solve the same problem you are experiencing, which is to INTERCEPT a mouse click without letting the current app interpret the click. I did succeed, but it required getting a smart mouse and reprogramming the primary mouse buttons. And even then, not all smart mice allow you to reprogram the primary mouse button because that's a very dangerous operation. And once I got it working, I felt that there was some noticeable lag introduced, so I stopped using that solution. I don't want my mouse to feel sluggish.

Let me add that I'm not one of the real gurus on this website, so there's a 20% chance that I'm wrong here. Feel free to wait for one of the real experts to answer.