Re: Current mouse screen?
Re: Current mouse screen?
- Subject: Re: Current mouse screen?
- From: Shaun Wexler <email@hidden>
- Date: Sat, 17 Apr 2004 10:51:00 -0700
On Apr 17, 2004, at 10:16 AM, Ondra Cada wrote:
Anybody knows how to find the screen the mouse is currently on? The
position is easy ([NSEvent mousePosition]), but I did not succeed to
find the screen...
NSPoint mouseLoc = [NSEvent mouseLocation];
NSEnumerator *screenEnum = [[NSScreen screens] objectEnumerator];
NSScreen screen;
while ((screen = [screenEnum nextObject]) && !NSMouseInRect(mouseLoc,
[screen frame], NO));
Usual disclaimers apply; written in Mail.app.
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
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.