Properties of a touch event

This page gives some overview on touchscreen events.

libinput requires all supported touchscreen to provide positional information and per-finger tracking. Positional information is provided for the events LIBINPUT_EVENT_TOUCH_DOWN and LIBINPUT_EVENT_TOUCH_MOTION with the functions libinput_event_touch_get_x() and libinput_event_touch_get_y(), as well as libinput_event_touch_get_x_transformed() and libinput_event_touch_get_y_transformed(). See also Absolute axes.

Some touchscreen provide additional information, specifically Major and minor axes, Touch point orientation, and Touch point pressure.

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

Note that the events LIBINPUT_EVENT_TOUCH_UP and LIBINPUT_EVENT_TOUCH_CANCEL do not provide any positional information or extended properties.

Major and minor axes

A finger contact on a touch screen provides an approximately alliptical contact area. The major axis of this ellipsis is along the pointing direction of the finger, the minor axis is perpendicular to the major axis.

libinput provides both major and minor axes as a physical dimension. See

Note that the granularity of the ellipsis is device-specific and usually less accurate than the positional information.

Not all touch screens support touch ellipsis detection. Where unavailable, libinput returns zero as value for the major and minor axes. Where only a major axis is available, libinput assumes a circular contact, the minor axis is then always equivalent to the major axis. Use libinput_event_touch_has_major() and libinput_event_touch_has_minor() to determine if the values are available.

Touch point orientation

The orientation of a touch is the angle (clockwise) between the major axis and the y-axis of the touchscreen. The granularity of the orientatoin value is device-specific, some devices may only detect alignment of the ellipsis with the y or x axis (i.e. 0 or 90 degrees rotation).

Use libinput_event_touch_has_orientation() to determine if the value is available and libinput_event_touch_get_orientation() to get the value. If the device does not support orientation, the orientation is always 0.

Touch point pressure

The pressure of a touch is the force applied to each contact point. Note that as touch pressure increases, the finger flattens and the contact surface area usually increases as well.

Use libinput_event_touch_get_pressure() to get the pressure value. This value is normalized to the range [0.0, 1.0]. Use libinput_event_touch_has_pressure() to determine if the value is available. A device that does not support pressure always returns a pressure value of 1.0.