• 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
Re: NSView mouseMoved problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView mouseMoved problem


  • Subject: Re: NSView mouseMoved problem
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 18 Dec 2012 00:41:42 -0800

On Dec 18, 2012, at 00:26 , Sanjay Arora <email@hidden> wrote:

> I want to receive mouseMoved on NSView of my window.
>
> I have set
> 		[self setAcceptsMouseMovedEvents:YES]; on my window and
>
> 		-(BOOL)acceptsFirstResponder returns yes.
>
>
> I do get mouseMoved event on my nsview, but the problem is I get these
> messages even if the mouse is not over my window, as long as is has the
> focus.
>
> Also, more problem is that if there is a window on top of my window (and
> I move the mouse on the top window) even then I get these messages in my
> nsview for my window (as noted in nsevent)?

There's generally no value in using 'setAcceptsMouseMovedEvents' any more -- as you've seen, it generates too many messages, and you have to throw away the ones you don't want.

Use NSTrackingArea instead. It also produces mouse-moved events, but only in the circumstances you configure.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

References: 
 >NSView mouseMoved problem (From: Sanjay Arora <email@hidden>)

  • Prev by Date: NSURL bookmark error return
  • Next by Date: Compiler can't find method declared in protocol
  • Previous by thread: NSView mouseMoved problem
  • Next by thread: NSURL bookmark error return
  • Index(es):
    • Date
    • Thread