• 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: The mouse is where?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The mouse is where?


  • Subject: Re: The mouse is where?
  • From: email@hidden
  • Date: Fri, 25 Jan 2008 16:19:19 -0800


On Jan 25, 2008, at 15:38, Jayson Adams wrote:

NSWindow has

	- (NSPoint)mouseLocationOutsideOfEventStream

and NSEvent has

	+ (NSPoint)mouseLocation



Ah, thanks for pointing those out, Jayson. Now that you mention them I do remember finding those in the past, way back in Tiger days.

Unfortunately, you don't actually win the $64. Although mouseLocationOutsideOfEventStream is *an* answer -- and an answer is a lot better than no answer -- it isn't *the* answer, because it's not synchronized with the event stream. Although it's where the mouse is *now*, it's not where the mouse is "now", but rather where the mouse "will be" when all the events currently queued have been dispatched.

At risk of being long-winded, I'll add that there are 2 situations where the distinction between now and "now" matters:

-- When an application starts up. Depending where the mouse is relative to the window that opens, something in that window might get rollover highlighted inappropriately.

-- When the first responder status changes to another view (such as a text field) and then changes back again without involving the mouse (such as tabbing back to the original view).

In both cases, explicitly retrieving the mouseLocationOutsideOfEventStream location will limit the effect to (at worst) a brief flash of incorrect highlighting, but that sort of thing reflects badly on the application in users' minds, I'd say.

Anyway, thanks for the response that moves me one step closer.
_______________________________________________

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


  • Follow-Ups:
    • Re: The mouse is where?
      • From: Jayson Adams <email@hidden>
References: 
 >The mouse is where? (From: email@hidden)
 >Re: The mouse is where? (From: Jayson Adams <email@hidden>)

  • Prev by Date: Re: Getting the content-type in a HTTP response
  • Next by Date: Re: Getting the content-type in a HTTP response
  • Previous by thread: Re: The mouse is where?
  • Next by thread: Re: The mouse is where?
  • Index(es):
    • Date
    • Thread