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.

Replies

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

Add a Comment

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"

  • Yes, that’s what I’m working on. Thank you for the tip, I’ll check that out

  • It is remote control application I’m working on. I need to be able to know the type of system cursors available and also know when the user changes the cursor image so I can notify my client.

Add a Comment

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"

  • I was hoping for something that delivers system wide cursor events like NSEvent.addLocalMonitorForEvents(matching: .cursorUpdate,handler: cursorEventReceived(_:)) does for local events.

Add a Comment

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"