mouseMoved events stolen by NSTextView
mouseMoved events stolen by NSTextView
- Subject: mouseMoved events stolen by NSTextView
- From: Tim Rodgers <email@hidden>
- Date: Fri, 12 Jan 2007 15:44:54 -0500
Hi all,
My app has a front window with a custom view which is set up to
accept mouseMoved events, and a background window that contains an
NSTextView, e.g. the default About New Application window. I move
the cursor around in the front window and the view receives
mouseMoved events. I move the cursor outside the window and I still
get mouseMove events but then... I move over the NSTextView of the
back window, without changing window ordering (don't click), and
mouseMoved events stop coming. The only way to get mouseMoved events
back in the custom view is to click on the front window.
I searched the Apple lists archives and Cocoa Dev and all those
places. I tried tracking rects and even though moving the mouse back
over my custom view generates a mouseEntered message, there's nothing
I can do in mouseEntered to bring back mouseMoved events. I tried to
makeKey the window, makeFirstResponder the view, and so on.
I have resorted to a timer in my application object which
periodically gets the current mouse location in screen coordinates,
does a hit test on the keyWindow, and if an interesting view is hit,
constructs an NSEvent object and passes it to the view's mouseMoved
method.
I verified all of this by starting with a fresh Cocoa Document-based
Application project and adding just enough code to cause mouseMoved
events to be passed to a custom view. It sure looks broken to me.
Has anyone else seen this behavior or am I being a noob, pwned by Cocoa?
TIA!
Tim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden