Re: Figuring out which NSView to send an event to
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