libinput  0.9.0
A wrapper library for input devices
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Functions
Touch events

Events from absolute touch devices. More...

Data Structures

struct  libinput_event_touch
 Touch event representing a touch down, move or up, as well as a touch cancel and touch frame events. More...
 

Functions

uint32_t libinput_event_touch_get_time (struct libinput_event_touch *event)
 
int32_t libinput_event_touch_get_slot (struct libinput_event_touch *event)
 Get the slot of this touch event. More...
 
int32_t libinput_event_touch_get_seat_slot (struct libinput_event_touch *event)
 Get the seat slot of the touch event. More...
 
double libinput_event_touch_get_x (struct libinput_event_touch *event)
 Return the current absolute x coordinate of the touch event, in mm from the top left corner of the device. More...
 
double libinput_event_touch_get_y (struct libinput_event_touch *event)
 Return the current absolute y coordinate of the touch event, in mm from the top left corner of the device. More...
 
double libinput_event_touch_get_x_transformed (struct libinput_event_touch *event, uint32_t width)
 Return the current absolute x coordinate of the touch event, transformed to screen coordinates. More...
 
double libinput_event_touch_get_y_transformed (struct libinput_event_touch *event, uint32_t height)
 Return the current absolute y coordinate of the touch event, transformed to screen coordinates. More...
 
struct libinput_eventlibinput_event_touch_get_base_event (struct libinput_event_touch *event)
 

Detailed Description

Events from absolute touch devices.

Function Documentation

struct libinput_event* libinput_event_touch_get_base_event ( struct libinput_event_touch event)
Returns
The generic libinput_event of this event
int32_t libinput_event_touch_get_seat_slot ( struct libinput_event_touch event)

Get the seat slot of the touch event.

A seat slot is a non-negative seat wide unique identifier of an active touch point.

Events from single touch devices will be represented as one individual touch point per device.

Note
this function should not be called for LIBINPUT_EVENT_TOUCH_CANCEL or LIBINPUT_EVENT_TOUCH_FRAME.
Returns
The seat slot of the touch event
int32_t libinput_event_touch_get_slot ( struct libinput_event_touch event)

Get the slot of this touch event.

See the kernel's multitouch protocol B documentation for more information.

If the touch event has no assigned slot, for example if it is from a single touch device, this function returns -1.

Note
this function should not be called for LIBINPUT_EVENT_TOUCH_CANCEL or LIBINPUT_EVENT_TOUCH_FRAME.
Returns
The slot of this touch event
uint32_t libinput_event_touch_get_time ( struct libinput_event_touch event)
Returns
The event time for this event
double libinput_event_touch_get_x ( struct libinput_event_touch event)

Return the current absolute x coordinate of the touch event, in mm from the top left corner of the device.

To get the corresponding output screen coordinate, use libinput_event_touch_get_x_transformed().

Note
this function should only be called for LIBINPUT_EVENT_TOUCH_DOWN and LIBINPUT_EVENT_TOUCH_MOTION.
Parameters
eventThe libinput touch event
Returns
the current absolute x coordinate
double libinput_event_touch_get_x_transformed ( struct libinput_event_touch event,
uint32_t  width 
)

Return the current absolute x coordinate of the touch event, transformed to screen coordinates.

Note
this function should only be called for LIBINPUT_EVENT_TOUCH_DOWN and LIBINPUT_EVENT_TOUCH_MOTION.
Parameters
eventThe libinput touch event
widthThe current output screen width
Returns
the current absolute x coordinate transformed to a screen coordinate
double libinput_event_touch_get_y ( struct libinput_event_touch event)

Return the current absolute y coordinate of the touch event, in mm from the top left corner of the device.

To get the corresponding output screen coordinate, use libinput_event_touch_get_y_transformed().

For LIBINPUT_EVENT_TOUCH_UP 0 is returned.

Note
this function should only be called for LIBINPUT_EVENT_TOUCH_DOWN and LIBINPUT_EVENT_TOUCH_MOTION.
Parameters
eventThe libinput touch event
Returns
the current absolute y coordinate
double libinput_event_touch_get_y_transformed ( struct libinput_event_touch event,
uint32_t  height 
)

Return the current absolute y coordinate of the touch event, transformed to screen coordinates.

Note
this function should only be called for LIBINPUT_EVENT_TOUCH_DOWN and LIBINPUT_EVENT_TOUCH_MOTION.
Parameters
eventThe libinput touch event
heightThe current output screen height
Returns
the current absolute y coordinate transformed to a screen coordinate