Properties of a touch event

This page gives some overview on touchscreen events.

With libinput touchscreens provide the event types LIBINPUT_EVENT_TOUCH_DOWN, LIBINPUT_EVENT_TOUCH_UP, LIBINPUT_EVENT_TOUCH_MOTION and LIBINPUT_EVENT_TOUCH_CANCEL. The touchscreen events LIBINPUT_EVENT_TOUCH_DOWN and LIBINPUT_EVENT_TOUCH_MOTION provide alongside the actual state change and the absolute coordinates (Handling of absolute coordinates) additional information about the touch contact.

touchscreen-touch-event-properties.svg
Properties of a touch screen contact

Assuming the interaction of fingers with a touch screen, touch contacts are approximated with an ellipse. The major axis of the ellipse describes the pointing direction of the finger. The minor axis is the perpendicular extent of the touching shape. The orientation angle is the clockwise rotation of the pointing direction against the y-axis of the touchscreen.

Additionally to the values shown in the drawing above, most touchscreens also provide a pressure value to indicate the force applied with the contact point.

The support for those contact properties varies between the different available touchscreens. In the case of pressure libinput will return the maximum pressure value, which is 1.0. If only the major axis but no minor axis is present, libinput will assume a circular shape and return the major axis value for convenience. If also no major axis value is known 0.0 is returned. If the orientation is not available libinput will return 0.0 degrees.

For querying the touch properties see:

For testing which of the touch properties are available see: