Re: event pressure:
Re: event pressure:
- Subject: Re: event pressure:
- From: Jonathan Chetwynd <email@hidden>
- Date: Sun, 11 Dec 2005 22:21:33 +0000
Mike,
thanks for that, %f certainly works. however I'm having difficulty
interpreting the documentation...
how does one use this value?
[path setLineWidth:%f*255]; //obviously isn't right...
cheers
Jonathan Chetwynd
Accessible Solutions
http://www.eas-i.co.uk
On 11 Dec 2005, at 20:41, Mike Paquette wrote:
On Dec 11, 2005, at 12:31 PM, Jonathan Chetwynd wrote:
NSLog(@"pressure: %d ", [event pressure]);
the output values are far too high: ~ 1080795136 or 1072693248
supposedly between 0 & 1
The "%d" format token expects an integer value. -pressure returns a
float value, which in many architectures (ahem) is returned in a
different register and with a different bitwise representation than
an integer. Try:
NSLog(@"pressure: %f ", [event pressure]);
The float will be promoted to a double per the standard C calling
conventions, and the format string %f will see a double and process
it properly.
See also:
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSEvent.html
pressure
Returns a value from 0.0 through 1.0 indicating the pressure applied
to the input device (used for appropriate devices).
- (float)pressure
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden