getting system wide cursor events possible?

I'm wondering if it is possible to get system wide NSEvent.cursorUpdate (or cursor events in any other form?)

NSEvent.addGlobalMonitorForEvents(matching: .cursorUpdate, handler: cursorEventReceived(_:))

That isn't working and all I documentation and examples I can find are local and involving a the apps view but my app does not have any views and still need to get them if possible.

Answered by DTS Engineer in 706443022

I was hoping for something that delivers system wide cursor events

I don’t know of any way to achieve that specifically. It’s possible that this exists and I just missed the memo. If you’d like one of my colleagues to research this properly, you could open a DTS tech support incident for that but, as always with TSIs, there’s no guarantee of success.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Please clarify what you mean by “cursor events” in this context. Are you interesting in learning about the cursor moving? Or the cursor changing shape?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

about the cursor changing shapes

Oh, interesting.

Why do you need to do this?

The most common reason that folks care about the system-wide cursor is that they’re doing some sort of screen sharing or screen capture product. In that case CGDisplayStream has your back via the kCGDisplayStreamShowCursor property. Is that what you’re doing? Or something else?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

It is remote control application I’m working on.

And when you apply kCGDisplayStreamShowCursor what happens?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

I was hoping for something that delivers system wide cursor events

I don’t know of any way to achieve that specifically. It’s possible that this exists and I just missed the memo. If you’d like one of my colleagues to research this properly, you could open a DTS tech support incident for that but, as always with TSIs, there’s no guarantee of success.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

getting system wide cursor events possible?
 
 
Q