Reputation: 82
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
Upvotes: 3
Views: 3692
Reputation: 10534
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.
Upvotes: 5
Reputation: 11
i solved this problem by putting this hack in the CCDirectorMac: after:
[fullScreenWindow_ makeMainWindow];
[fullScreenWindow_ makeKeyAndOrderFront:self];
set acceptMouseMovedEvents to yes:
[fullScreenWindow_ setAcceptsMouseMovedEvents:YES];
Upvotes: 1
Reputation: 8292
Try enabling mouseMoved events on the window containing the view via the NSWindow class's setAcceptsMouseMovedEvents: method
Upvotes: 2