Spacebar as toggle for mouse click/release

For drawing with a stylus on my trackpad, I’d like to create a macro where tapping the spacebar simulates holding the left mouse button and tapping again simulates releasing it. There’s probably a simple solution, but I’m new to KM and have spent a long time on this and came up empty-handed.

The macro would look something like this:

image

Some key information to keep in mind:

  • The trigger is a Hot Key, in this case Space;
  • The simulated mouse click is at 0,0 relative to the current mouse location.

Those facts are shown in the image but need to be specified when creating the macro.

First, though, is what isn't shown. Before making the above macro, create a Macro Group so this behavior will only be available in the application(s) where the stylus drawing is done. Without a Macro Group to limit the availability of this macro to certain applications, pressing Space would cause a left mouse click in any application.

To create a Macro Group...

  • In the Keyboard Maestro Editor, click the + button at the bottom of the left-most column. That will create a new Macro Group.
  • Name it however you'd like.
  • In the right-most column, select Available In These Applications and choose only the applications where you'd like this macro to work.

With that in place, create a macro like is shown above using the Move Or Click Mouse action.

1 Like

Neat!

Keep safe...