5

I've got an app with a custom cursor which I achieved using a custom wrapper for NSCursor (most of the main code is designed to be OS portable, so above that I pretend the NSCursor is a Windows-style cursor). I'm having a few issues with the cursor not changing back to my custom one when the user cmd+tabs back into the window, and I'd like to see what is changing the value of currentCursor. Everywhere I've tried to set breakpoints has given me nothing so far.

So, I was wondering if there was a way (in Xcode) to break as soon as the value of [NSCursor currentCursor] changes. Is this possible? Is this kind of data accessible to my app?

Thanks - I hope I've made myself clear. It's quite hard to explain when I'm not even sure what I want to do!

General Grievance
  • 4,555
  • 31
  • 31
  • 45
benwad
  • 6,414
  • 10
  • 59
  • 93
  • NSCursor's currentCursor method only returns the current cursor for the current app. The currentSystemCursor will return (a copy of) the current (system) cursor (for whatever app is running). In theory you could poll this via a timer (since there doesn't seem to be a notification that you may register for for this). – geowar Feb 15 '13 at 21:18

1 Answers1

0

NSCursor has a class method currentSystemCursor that will give you what you need in 10.6 and later.

uchuugaka
  • 12,679
  • 6
  • 37
  • 55