• 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 get mouse location for a nonmouse event?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get mouse location for a nonmouse event?


  • Subject: Re: How to get mouse location for a nonmouse event?
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 27 Jul 2005 11:56:06 -0400
  • Organization: Rogue Research

On 2005-07-26 18:48, Timothy J. Wood said:

>> How does one get the mouse location at the time an event occurred?
>> There is "locationInWindow" who's docs say "Returns the receiver's
>> location in the base coordinate system of the associated window. For
>> nonmouse events the return value of this method is undefined.".  But I
>> need to know the mouse position for a nonmouse event (keydown & keyup
>> events actually).
>
>   +[NSEvent mouseLocation] should work unless you require very
>extremely
>fine synchronization of the time of the event generation and the
>grabbing
>of the position (i.e., the mouse is moving).

Well, I guess that will have to do unless someone else knows a better
way... ideally I'd like to know the mouse position at the exact time of
the key down event, not slightly later.

Thanks!

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
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

References: 
 >How to get mouse location for a nonmouse event? (From: "Sean McBride" <email@hidden>)
 >Re: How to get mouse location for a nonmouse event? (From: "Timothy J. Wood" <email@hidden>)

  • Prev by Date: Re: Composite values using Core Data and Cocoa Bindings
  • Next by Date: CoreData: How to create two separate in-memory stores?
  • Previous by thread: Re: How to get mouse location for a nonmouse event?
  • Next by thread: NSScanner instert space every 2 characters
  • Index(es):
    • Date
    • Thread