Re: flagsChanged: not being called on NSControl subclass


Steve Mills
 

On May 20, 2019, at 11:29, James Walker <list2@...> wrote:

Does your control actually become first responder? That might be necessary for flagsChanged: to go to your control.
Aha! No, it was not. It does now and I’m getting flagsChanged. I guess that makes sense that the OS only sends those to the firstResponder. Thanks for your hunch.

Another option might be to use +[NSEvent addLocalMonitorForEventsMatchingMask:handler:].
Extending your suggestion, I added a global monitor so I could change the cursor in my floating window when the app wasn’t frontmost, but sadly it appears you can’t change the cursor when you’re not the front app, even if the mouse is over your window that’s in front of other apps’ windows. Oh well. The app I’m replacing couldn’t do that either.

Steve via iPhone

Join cocoa@apple-dev.groups.io to automatically receive all group messages.