I make small Mac apps you buy once. The newest is MacMuse Recorder , a screen recorder whose main feature is automatic zoom: you click around while recording, and the finished video pushes in on the part that matters.
Screen Studio made that look popular. What I wanted on top of it was control: every zoom should be an ordinary block on the timeline, so when the guess is wrong you drag it, retime it or delete it instead of fighting it.
This post is how that works under the hood. Everything is Swift on macOS 15+, and the snippets are the real code.
1. Record more than pixels
While ScreenCaptureKit writes the video, the app keeps three other streams:
Cursor samples.
Clicks , from an NSEvent global monitor for mouse-down events.
Activity. ScreenCaptureKit attaches dirty rects to each frame: the regions that changed since the last one.…