Individual MouseDown and MouseUp Events?

Hi there! I'm switching from ControllerMate because of sudden incompatibility (whoops, should not have updated my OS!), and I'm trying to recreate my work setup in Keyboard Maestro. I realize these tools have different focuses, but so far I'm impressed by KM's power and versatility!

I'm trying to recreate the click functionality of a mouse, but with a device that isn't a mouse. In this case, I want three keys on this X-Key device to behave just like normal Left, Right and Middle mouse buttons.

(Context: I destroyed my arm from wayyy too much computer use, and can no longer physically click a mouse with my right hand. For the last several years with X-Keys and ControllerMate, I've been aiming with the right and shooting with the left. :stuck_out_tongue: )

With Keyboard Maestro, I can get 90% of the way there in no time. It works great when I want to click. But if I press and hold, it still only clicks. Like, once.

Instead, I'd like it to behave like I'm pressing and holding a mouse button: with a MouseDown event triggered when the device key "is pressed," and a separate MouseUp event triggered when the device key "is released." It's interesting that these separate events are acknowledged in KM with keys but not mouse buttons.

OtherViews_and_Keyboard_Maestro_Editor_β€”Click–_Left4

I've tried a few different methods to make this work.This thread seems adjacent, but the solutions seem clunky, and trying to implement them I've bumped into further issues:

  • "Pause Until" action doesn't have a "USB Device Key Trigger" condition. If it did, I would have it Pause Until the key was released. However:
  • The "dragging" that one can otherwise achieve with this Pause method (with a non-USB device, like a normal keyboard) is not actually dragging. It just records the start and end position and pops to the result upon release.

Without this functionality, I can't do a lot of basic stuff, like... move this browser window around. Any way this might be possible?

Thanks for any help!

--Colin

click and hold?

Oh, true – I didn't address the obvious: click and hold doesn't work.

I messed up my own screenshot. I have it set to "and hold"... but it behaves just the same as just click. That's the first thing I tried, and... you know, maybe that's all I'm looking for – a way to make "click and hold" actually click and hold.

But if you click the yellow triangle, you'll see this Action Warning:

So it seems as if it needs another Action afterwards. I guess if I have to use a "Pause Until" action then I'd like it to "Pause Until" my device key is released. But unfortunately this option doesn't exist.

Hope I'm explaining this clearly? Thanks for any further ideas!

Yes you're almost there, add a Pause until: after the click one
image

2 Likes

Hi, thanks for the tip! Since I'm using a non-mouse device to do the clicking, I wasn't sure if that was going to work. But seems like it's inherits the 'mouse button' from the previous Action. Yes – this seems to get me a lot closer!

However, I'm experiencing some side effects of this method. Mostly choppiness and failure to "release"...

Watch this screen capture for a quick demo / comparison:

Anything I should try?

Thank you!

--Colin

1 Like