Search code examples
objective-ccocoansviewnsresponder

mouseMoved not called when over the View


I have subclass of NSView which implements mouseMoved.

However when I move my mouse over the view the mouseMoved never gets called. Why?

I am on OS X Lion.

Thanks, Vance


Solution

  • Even with -setAcceptsMouseMovedEvents:, your view will only get -mouseMoved: when it is the first responder. If you want to receive mouse moved events when your view isn't first responder, give NSTrackingArea a look.