NSEvent locationInWindow undefined for non-mouse events, how to catch?

2012-02-13 Thread Sean McBride
Hi all, The NSEvent locationInWindow docs say: "For non-mouse events the return value of this method is undefined." I've just been bitten by this. Seems it would be easy to detect at runtime and assert, is there any magic environment variable or defaults value that can help me catch such inco

Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?

2012-02-14 Thread Seth Willits
On Feb 13, 2012, at 1:25 PM, Sean McBride wrote: > The NSEvent locationInWindow docs say: "For non-mouse events the return value > of this method is undefined." > > I've just been bitten by this. Seems it would be easy to detect at runtime > and assert, is there any magic environment variable

Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?

2012-02-14 Thread Martin Wierschin
> I've just been bitten by this. Seems it would be easy to detect at runtime > and assert, is there any magic environment variable or defaults value that > can help me catch such incorrect usage? I've searched but not found... I don't know if there's any runtime/debug value, but this is one of

Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?

2012-02-14 Thread Jim McGowan
On 15 Feb, 2012, at 1:18 , cocoa-dev-requ...@lists.apple.com wrote: > The NSEvent locationInWindow docs say: "For non-mouse events the return value > of this method is undefined." > > I've just been bitten by this. Seems it would be easy to detect at runtime > and assert, is there any magic e

Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?

2012-02-14 Thread Kyle Sluder
On Feb 14, 2012, at 8:18 PM, Jim McGowan wrote: > On 15 Feb, 2012, at 1:18 , cocoa-dev-requ...@lists.apple.com wrote: > >> I've just been bitten by this. Seems it would be easy to detect at runtime >> and assert, is there any magic environment variable or defaults value that >> can help me ca

Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?

2012-02-15 Thread Sean McBride
On Tue, 14 Feb 2012 21:08:38 -0800, Kyle Sluder said: >> Are you calling -type on the events you are receiving? Checking that >value should make it clear whether the event you have received is a >mouse event or not. If not, and you need the mouse location, you can >get if from NSEvent's +mouseLoc

Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?

2012-02-15 Thread Gary L. Wade
What it sounds like you're really asking in the latest part of this thread is for every object in a given runtime to track the messages called upon it with a time stamp in order to compare those for an exact ordering of calls conducive to your needs. That COULD be useful, but it would be really

Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?

2012-02-15 Thread Sean McBride
On Wed, 15 Feb 2012 09:56:33 -0800, Gary L. Wade said: >What it sounds like you're really asking in the latest part of this >thread is for every object in a given runtime to track the messages >called upon it with a time stamp in order to compare those for an exact >ordering of calls conducive to

Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?

2012-02-15 Thread Quincey Morris
On Feb 15, 2012, at 08:12 , Sean McBride wrote: > In the meantime, I'll create a category method that wraps locationInWindow > and delegates to mouseLocation or similar otherwise. Depending on how correct you want to be, you do have to be a bit cautious with this. +[NSEvent mouseLocation] isn't