Pen and Pressure considerations


Touch and pen devices can support pressure value to represent how hard the stylus/pen is being pushed on to the touch surface.

Pen Attributes

For pen devices, the API passes the following flags and values. This caters for all Pen attributes except twist.

 Flags Values
   
Pressure Considerations

 To determine if pressure is supported, the zSupport attribute of digitiserEvent should be used, as seen in line 202 below

There is no way to get either the max value or determine if pressure will be reported until an event is received.

If you need to determine the actual maximum pressure (Z) value that a specific Report ID can send, this should be obtained from observing the actual max value, as we no longer make this available on the API.

The digitizer_event command 'Upddutils de' shows the Z value for pressure devices:

We did at one point offer TBApiGetMaxZ API function.

However, we concluded that there are issues trying to determine this value, and we made some assumptions that are not correct.

A device can have multiple “maxz” values (one per report id) and these do not necessarily reflect the theoretical max value in any case.

Search