I'm working on a tool that takes and displays screenshots of certain windows using CGWindowListCreateImageFromArray. However, I need the screenshot to include the mouse cursor as well. The only way to do that I'm aware of is compositing in the mouse cursor into the screenshot myself, which requires getting an image of the mouse cursor at the time the screenshot is taken. For that I've been using NSCursor.currentSystemCursor.image.
Post
Replies
Boosts
Views
Activity
(Part 1 - comments don't let me write enough text!)
I'm not sure if that'll work for my use case, actually. The tool I'm making is essentially a specialized magnifier tool, but I don't necessarily want the magnification to include the cursor as it appears on screen. For one, the cursor may be hidden, with the intent that it'll only be visible in the magnifier. (I'm not sure if SCStreamConfiguration.showsCursor will still allow capturing the cursor even if it's currently hidden.)
(Part 2)
I'm also compositing in an image of the cursor into the magnifier window at a customizable size. In order to do this, I basically need to be able to get the image of the current cursor in isolation from any other element on screen. Basically I need the exact functionality as NSCursor.currentSystemCursor.image.