• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
mouseMoved events stolen by NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: nstask with admin privs
  • Next by Date: Re: Activating applications
  • Previous by thread: Strange use of files in the Trash
  • Next by thread: Illegal NSTableView data source
  • Index(es):
    • Date
    • Thread