• 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: locationInWindow not valid for key event (as opposed to mouse event)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: locationInWindow not valid for key event (as opposed to mouse event)?


  • Subject: re: locationInWindow not valid for key event (as opposed to mouse event)?
  • From: "Michael B. Johnson" <email@hidden>
  • Date: Sun, 6 Jan 2002 17:31:01 -0800

In case my last message wasn't clear enough, here's the code to reproduce what I'm talking about. Note that the locationInWindow is always nonsense (and usually the same, no matter where you move the mouse when you press/release a modifier key), while the mouseDown: one is fine.

I would expect, from the documentation and header (and because I need it :-)) that it would be valid in both routines.

Thoughts? I realize it's the day before Steve's talk, so lots of folks are either sleeping or ignoring email, but...

// put the following in a minimal NSView subclass and click around and press/release modifier keys:

- (BOOL)acceptsFirstResponder
{
return TRUE;
}

- (void)flagsChanged:(NSEvent *)theEvent
{
NSPoint xy = [theEvent locationInWindow];
NSLog(@"flags changed to %d at %f %f in window %@:",
[theEvent modifierFlags], xy.x, xy.y, [theEvent window]);
return ;
}

- (void)mouseDown:(NSEvent *)theEvent
{
NSPoint xy = [theEvent locationInWindow];
NSLog(@"mouseDown: at %f %f in window %@:", xy.x, xy.y, [theEvent window]);
return ;
}

--> Michael B. Johnson, Ph.D. -- email@hidden
--> Studio Tools, Pixar Animation Studios
--> http://xenia.media.mit.edu/~wave


  • Prev by Date: Re: Showing a window from a second nib
  • Next by Date: (NSBrowser) Getting selected cell's column
  • Previous by thread: thanks
  • Next by thread: (NSBrowser) Getting selected cell's column
  • Index(es):
    • Date
    • Thread