Re: How does Pixie get the mouse position?
Re: How does Pixie get the mouse position?
- Subject: Re: How does Pixie get the mouse position?
- From: Dietmar Planitzer <email@hidden>
- Date: Wed, 9 Jun 2004 22:36:08 +0200
On Jun 8, 2004, at 10:32 PM, John MacDonnell wrote:
Hello Gurus!
anybody has an event driven code to get the mouse move events despite
my application it is not in foreground?
I know I can set a Timer and get the [NSEvent mouseLocation]; but at
school someone taught me that polling must be avoided as often as
possible!
I think about the Apple application called Pixie, it gets the mouse
cursor position as I want,
any clue?
I suspect that it simply does what the QuickTime movie controller and
many interactive media components do: namely, they call GetMouse(),
Button() and GetKeys() for each and every frame of a movie.
Those functions return the current state of the mouse and keyboard
input devices as far as I known no matter if your app is in the
foreground or the background. The only thing you have to keep in mind
is that you must set a valid GrafPort before you call GetMouse()
because it returns the mouse coordinates in local coordinates (relative
to the current GrafPort).
Regards,
Dietmar Planitzer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.