Product SiteDocumentation Site

A.18. wl_touch - touchscreen input device

The wl_touch interface represents a touchscreen associated with a seat.
Touch interactions can consist of one or more contacts. For each contact, a series of events is generated, starting with a down event, followed by zero or more motion events, and ending with an up event. Events relating to the same contact point can be identified by the ID of the sequence.

A.18.1. Events provided by wl_touch

A.18.1.1. wl_touch::down - touch down event and beginning of a touch sequence

A new touch point has appeared on the surface. This touch point is assigned a unique @id. Future events from this touchpoint reference this ID. The ID ceases to be valid after a touch up event and may be re-used in the future.

wl_touch::down arguments

serial
Type: uint
time
Type: uint
timestamp with millisecond granularity
surface
Type: object
id
Type: int
the unique ID of this touch point
x
Type: fixed
x coordinate in surface-relative coordinates
y
Type: fixed
y coordinate in surface-relative coordinates

A.18.1.2. wl_touch::up - end of a touch event sequence

The touch point has disappeared. No further events will be sent for this touchpoint and the touch point's ID is released and may be re-used in a future touch down event.

wl_touch::up arguments

serial
Type: uint
time
Type: uint
timestamp with millisecond granularity
id
Type: int
the unique ID of this touch point

A.18.1.3. wl_touch::motion - update of touch point coordinates

A touchpoint has changed coordinates.

wl_touch::motion arguments

time
Type: uint
timestamp with millisecond granularity
id
Type: int
the unique ID of this touch point
x
Type: fixed
x coordinate in surface-relative coordinates
y
Type: fixed
y coordinate in surface-relative coordinates

A.18.1.4. wl_touch::frame - end of touch frame event

Indicates the end of a contact point list.

A.18.1.5. wl_touch::cancel - touch session cancelled

Sent if the compositor decides the touch stream is a global gesture. No further events are sent to the clients from that particular gesture. Touch cancellation applies to all touch points currently active on this client's surface. The client is responsible for finalizing the touch points, future touch points on this surface may re-use the touch point ID.