• 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: Figuring out which NSView to send an event to
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Figuring out which NSView to send an event to


  • Subject: Re: Figuring out which NSView to send an event to
  • From: Ken Thomases <email@hidden>
  • Date: Tue, 04 Sep 2012 08:38:48 -0500

On Sep 4, 2012, at 6:28 AM, Akhil Jindal wrote:

> I’m trying to use the Wacom’s Feel Multi-Touch API to capture touch events
> in my app. I have their cintiq hardware connected to my iMac.

> Using NSWindowList, and iterating over them, I find the window to which the
> event should belong.

Don't do that.  Use +[NSWindow windowNumberAtPoint:belowWindowWithWindowNumber:] and -[NSApplication windowWithWindowNumber:].

> Now I have to find the NSView within the window.

Use -[NSView hitTest:] on the window's content view.  Be sure to get the coordinates right.  They need to be in the coordinate space of the superview of the content view, which you don't have direct access to, but you can ask the content view for its superview.

Regards,
Ken


_______________________________________________

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: 
 >Figuring out which NSView to send an event to (From: Akhil Jindal <email@hidden>)

  • Prev by Date: Re: Figuring out which NSView to send an event to
  • Next by Date: Re: Figuring out which NSView to send an event to
  • Previous by thread: Re: Figuring out which NSView to send an event to
  • Next by thread: How to Identify a "Phantom" Write Operation
  • Index(es):
    • Date
    • Thread