I aim to develop a command-line program for macOS in C that hides the cursor system-wide after 8 seconds of inactivity, similar to Cursorcerer but using a LaunchAgent service and a configuration file (~/.config/cursorhiderrc). Cursorcerer’s code is unavailable, but references suggest utilizing Apple hook functions (like those detailed here: https://web.archive.org/web/20150609013355/http://lists.apple.com:80/archives/carbon-dev/2006/Jan/msg00555.html). How can I achieve this functionality?
The program needs to run discreetly in the background, triggered by a LaunchAgent, and configurable via a specified config file (~/.config/cursorhiderrc). The end goal is to automatically hide the cursor after a specified delay from the config, enhancing user experience during presentations or media consumption or terminal play.
I have used Cursorcerer and found it operates via a system preferences pane, rather than a command-line tool. I’ve explored Apple’s Carbon API references and the archived Apple developer mailing list, but I’m uncertain how to translate this into a C program which actually hides the cursor (But I can develop the LaunchAgent integration).
Alex Spaulding is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.