views:

159

answers:

3

Interestingly i didn't find the answer for this seemingly trivial question - Cocoas mouse events have z-coordinates - what are they for?

+4  A: 

It is described in for the absoluteZ function:

For the coordinate to be valid, the receiver should represent an event generated by a tablet pointing device (otherwise 0 is returned). The z coordinate does not represent pressure. It registers the depth coordinate returned by some tablet devices with wheels; if the device is something other than these, 0 is returned. This method is valid only for mouse events with a subtype of NSTabletPointEventSubtype and for events of type NSTabletPoint.

ashcatch
D'oh, thanks - they hid it well. All the guides only say there *is* a z-coordinate, but never say what for.
Georg Fritzsche
A: 

I suppose its for (potential) 3D input-devices which have a third axis. That third axis could be anything from a depth information to pressure (from a stylus) etc. It depends on the device

das_weezul
+1  A: 

Compatibility with a tablet.

Google is your friend. http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/Reference/Reference.html

Ron
I wouldn't have asked without googling first and had looked at the NSEvent documentation. ;)
Georg Fritzsche
Not trying to be a jerk, but if you search for "z" on that documentation page, there are only 19 occurrences, and the `-absoluteZ` method explains it clearly. That said, @Ron could have noticed that you linked to the exact same documentation in your question, just a different part.
Quinn Taylor
@Quinn: Maybe i could have searched the page, but i don't think its natural to expect that exactly one method documents what it is for and it isn't mentioned at all in any overview. I call that hidden.
Georg Fritzsche
@Quinn: Oh, and not to forget - if i don't find the answer for such a question trivially via the first google page there is a question missing on SO :)
Georg Fritzsche
I might call it non-obvious, but not hidden. Hidden implies intentional concealment. It's probably not in the overview because most developers will never explicitly deal with tablet input. That's not to say it the delta methods can't point you in the right direction. Just sayin', it's probably more likely to be an oversight than intentional. And I agree, always better to have the question than not. :-)
Quinn Taylor