Hide Mouse Pointer?

Is there any way to hide the mouse pointer while doing mouse actions in a macro? It would look much more polished if the mouse pointer wasn't bouncing all over my screen as I'm using executing actions to move to a UI element and click on it and then restore the mouse's original position. I'm thinking of some sort of a stealth mode...

1 Like

Interesting question. I just googled it. You can press FN+UP to make the mouse disappear. But I can't seem to type that key with the KM Type Keystroke action. There are utilities that can do this, but you want to do it with KM. I'll keep looking.

EDIT: the fact that there are utilities out there whose sole purpose is to "hide the macOS mouse" strongly suggests that there is no direct/supported way using the macOS GUI to hide the mouse (otherwise nobody would bother to make such a utility.) Since KM uses only public macOS APIs, as part of its design philosophy, that suggests that you can't do it with KM either. So what you have to do to fix this is get one of those utilities which you can then call with a KM action. Just google "cursorcerer" but I don't know if this utility is safe or not. Of course, I hope I'm wrong and someone else tells us how to do it. There's a 50% chance I'm wrong.

1 Like

Hmm. I tried the FN-Up thing on my mac and, as far as I can tell, it only is happening when Safari is in the foreground. The fact that it can be hidden at all seems to indicate that there might be a way to make it happen.

That's a good observation. But I tried four apps (Terminal, Preview, Messages, Safari) and it worked for three of them. So it may be app-dependent. Still, that's a good observation that I didn't test for.

The fact that macOS can make it happen does not mean that macOS provides any way for other apps to make it happen. There are hidden APIs that only Apple has access to. This could be one of them. And the fact that this feature is attached the the use of the FN key, which is not a normal modifier key, suggests there is no way for other apps to do this. For example, you can't assign FN+ANYKEY to anything in the System Preferences / Keyboard Shortcuts. To me, that's strong evidence this is a private function that only Apple can access. But I hope I'm wrong.

On my Mojave system fnUpArrow just pages up. The cursor remains...

I didn't mention the following, but even on Monterey, the cursor reappears the moment you move the mouse. So the first couple of times I tried this, I moved the mouse to see if it disappeared, and moving it made it reappear, so I thought it had failed under Monterey. So I mention it to you in case you made the same mistake I did (and also for people who have Monterey that may make the same mistake I did.)

The same happens in Mojave; you move the mouse and the pointer reappears.

Good to hear. But it's interesting to note that macOS process "FN+UP" to make the mouse disappear but then passes "UP" to the underlying app. Pretty sloppy GUI if you ask me. I think this also implies that the FN+UP is accessing a private API.

@peternlewis ?

The mouse appearance is controlled by the front application (more specifically the window the mouse is over). Keyboard Maestro cannot make the mouse disappear in other application windows.

For things like the Prompt for Screen Rectangle action, Keyboard Maestro actually has an invisible full screen window, which would not work in practice all the time, since it would interfere with clicks.

Bummer, but makes sense. Thanx for the reply.

Actually, I was able to get this to work by using the pref pane: "Cursorcerer" that @Sleepy recommended. It's a utility that toggles the mouse pointer visibility when a shortcut key is typed. I added actions to type that shortcut as the first and last step in my Click & Restore Mouse Position macro and now the buttons in the GUI get pressed without the mouse pointer looking like it was the one that performed the click. Neat!

2 Likes

I'm glad it is working for you - other apps are often willing to dig deeper in to the OS than Keyboard Maestro will (which is ironic given what Keyboard Maestro does!). On the other hand, if Cursorcerer breaks or stops working for any reason with an OS version update, it probably isn’t going to be too big a problem, but if Keyboard Maestro stops working, well, I don't know about you, but it feels like my Mac has utterly failed when Keyboard Maestro Engine is not running for me.

5 Likes