• 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: How to find a window under the cursor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: How to find a window under the cursor
      • From: Jiri Volejnik <email@hidden>
References: 
 >How to find a window under the cursor (From: Jiri Volejnik <email@hidden>)
 >Re: How to find a window under the cursor (From: Cybereer <email@hidden>)
 >Re: How to find a window under the cursor (From: Jiri Volejnik <email@hidden>)
 >Re: How to find a window under the cursor (From: Cybereer <email@hidden>)
 >Re: How to find a window under the cursor (From: Jiri Volejnik <email@hidden>)

  • Prev by Date: Re: Continuously write content of log file to NSTextView
  • Next by Date: Re: more than one plist in a file.
  • Previous by thread: Re: How to find a window under the cursor
  • Next by thread: Re: How to find a window under the cursor
  • Index(es):
    • Date
    • Thread