Re: How to find a window under the cursor
Re: How to find a window under the cursor
- Subject: Re: How to find a window under the cursor
- From: Cybereer <email@hidden>
- Date: Fri, 2 Dec 2005 10:48:30 -0500
Actually, I did mean mouseEntered that should be called for both
foreground and background apps, not mouseMoved that only works when
your app is active.
However, there seems to be a bug (at least in Tiger), so that
mouseEntered never gets called regardless. The workaround is to
override -sendEvent: of NSApplication and track NSMouseEnterd there.
On Dec 1, 2005, at 6:00 PM, Jiri Volejnik wrote:
On Dec 1, 2005, at 22:31, Cybereer wrote:
Are you trying to find windows of other apps?
No, I don't.
If true, you could do a hit test for all onscreen windows. For
windows of your own app, all you have to do is to call
setAcceptsMouseMovedEvents and track the mouse enter by overriding
-mouseEntered: method which works for background window.
You probably mean -mouseMoved:, not mouseEntered: message.
Tracking mouseMoved events works fine for me, there is no problem.
But it tells me nothing about the window under the cursor! Events
passed to mouseMoved: method contain a pointer to the main window,
not the window under the cursor, as I already mentioned. If you
move the cursor out of your window, or if you move it to another
window of your app, by sending -window to the event you still get
only a pointer to the main window! The message hitTest: works
well, but one have to send it to the view of the right window,
otherwise he can easily get nonsense, as the window may be
overlapped by a floating panel, for example.
Regards,
Jiri
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden