A value from 0
through 1
indicating the degree of pressure applied to an appropriate input device.
SDK
- macOS 10.0+
Framework
- App
Kit
Declaration
@property(readonly) float pressure;
Discussion
For input devices that are pressure-sensitive, the value is increased as pressure is applied to the device.
For NSEvent
events, pressure value relates to the current stage
of the gesture event. Each stage has its own pressure curve. For example, pressure ranges from 0
through 1
for a stage 1 event, and 0
through 1
for a stage 2 event. Pressure readings should be retrieved for a single stage of a gesture only, and should not be combined to achieve a wider range of pressure levels. In most cases, retrieving pressure during stage 1 is sufficient and appropriate for supporting variable input. Stage 1 pressure is the most physically comfortable for the user. Stage 2 pressure should only be used in rare circumstances where additional tactile feedback is necessary prior to retrieving pressure level.
For input devices that aren’t pressure-sensitive, the value is either 0
or 1
. An NSInternal
exception is raised if this property is accessed on an event other than a mouse-up, mouse-down, mouse-drag, NSTablet
, or NSEvent
event.
For tablet pointing devices that are in proximity, the pressure value is 0
if the user is not actually touching the tablet.
Pressure is not intended to measure weight.