質問

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

役に立ちましたか?

解決

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.

他のヒント

Try enabling mouseMoved events on the window containing the view via the NSWindow class's setAcceptsMouseMovedEvents: method

i solved this problem by putting this hack in the CCDirectorMac: after:

 [fullScreenWindow_ makeMainWindow];
 [fullScreenWindow_ makeKeyAndOrderFront:self];

set acceptMouseMovedEvents to yes:

 [fullScreenWindow_ setAcceptsMouseMovedEvents:YES];
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top