libinput  0.4.0
A wrapper library for input devices
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Pointer events

Pointer events reflect motion, button and scroll events, as well as events from other axes. More...

Functions

uint32_t libinput_event_pointer_get_time (struct libinput_event_pointer *event)
 
double libinput_event_pointer_get_dx (struct libinput_event_pointer *event)
 Return the delta between the last event and the current event. More...
 
double libinput_event_pointer_get_dy (struct libinput_event_pointer *event)
 Return the delta between the last event and the current event. More...
 
double libinput_event_pointer_get_absolute_x (struct libinput_event_pointer *event)
 Return the current absolute x coordinate of the pointer event, in mm from the top left corner of the device. More...
 
double libinput_event_pointer_get_absolute_y (struct libinput_event_pointer *event)
 Return the current absolute y coordinate of the pointer event, in mm from the top left corner of the device. More...
 
double libinput_event_pointer_get_absolute_x_transformed (struct libinput_event_pointer *event, uint32_t width)
 Return the current absolute x coordinate of the pointer event, transformed to screen coordinates. More...
 
double libinput_event_pointer_get_absolute_y_transformed (struct libinput_event_pointer *event, uint32_t height)
 Return the current absolute y coordinate of the pointer event, transformed to screen coordinates. More...
 
uint32_t libinput_event_pointer_get_button (struct libinput_event_pointer *event)
 Return the button that triggered this event. More...
 
enum libinput_button_state libinput_event_pointer_get_button_state (struct libinput_event_pointer *event)
 Return the button state that triggered this event. More...
 
uint32_t libinput_event_pointer_get_seat_button_count (struct libinput_event_pointer *event)
 For the button of a LIBINPUT_EVENT_POINTER_BUTTON event, return the total number of buttons pressed on all devices on the associated seat after the the event was triggered. More...
 
enum libinput_pointer_axis libinput_event_pointer_get_axis (struct libinput_event_pointer *event)
 Return the axis that triggered this event. More...
 
double libinput_event_pointer_get_axis_value (struct libinput_event_pointer *event)
 Return the axis value of the given axis. More...
 
struct libinput_event * libinput_event_pointer_get_base_event (struct libinput_event_pointer *event)
 

Detailed Description

Pointer events reflect motion, button and scroll events, as well as events from other axes.

Function Documentation

double libinput_event_pointer_get_absolute_x ( struct libinput_event_pointer *  event)

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

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

For pointer events that are not of type LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE.
Returns
the current absolute x coordinate
double libinput_event_pointer_get_absolute_x_transformed ( struct libinput_event_pointer *  event,
uint32_t  width 
)

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

For pointer events that are not of type LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE, the return value of this function is undefined.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE.
Parameters
eventThe libinput pointer event
widthThe current output screen width
Returns
the current absolute x coordinate transformed to a screen coordinate
double libinput_event_pointer_get_absolute_y ( struct libinput_event_pointer *  event)

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

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

For pointer events that are not of type LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE.
Returns
the current absolute y coordinate
double libinput_event_pointer_get_absolute_y_transformed ( struct libinput_event_pointer *  event,
uint32_t  height 
)

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

For pointer events that are not of type LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE, the return value of this function is undefined.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE.
Parameters
eventThe libinput pointer event
heightThe current output screen height
Returns
the current absolute y coordinate transformed to a screen coordinate
enum libinput_pointer_axis libinput_event_pointer_get_axis ( struct libinput_event_pointer *  event)

Return the axis that triggered this event.

For pointer events that are not of type LIBINPUT_EVENT_POINTER_AXIS, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_POINTER_AXIS.
Returns
the axis triggering this event
double libinput_event_pointer_get_axis_value ( struct libinput_event_pointer *  event)

Return the axis value of the given axis.

The interpretation of the value is dependent on the axis. For the two scrolling axes LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL and LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, the value of the event is in relative scroll units, with the positive direction being down or right, respectively. The dimension of a scroll unit is equal to one unit of motion in the respective axis, where applicable (e.g. touchpad two-finger scrolling).

For pointer events that are not of type LIBINPUT_EVENT_POINTER_AXIS, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_POINTER_AXIS.
Returns
the axis value of this event
struct libinput_event* libinput_event_pointer_get_base_event ( struct libinput_event_pointer *  event)
Returns
The generic libinput_event of this event
uint32_t libinput_event_pointer_get_button ( struct libinput_event_pointer *  event)

Return the button that triggered this event.

For pointer events that are not of type LIBINPUT_EVENT_POINTER_BUTTON, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_POINTER_BUTTON.
Returns
the button triggering this event
enum libinput_button_state libinput_event_pointer_get_button_state ( struct libinput_event_pointer *  event)

Return the button state that triggered this event.

For pointer events that are not of type LIBINPUT_EVENT_POINTER_BUTTON, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_POINTER_BUTTON.
Returns
the button state triggering this event
double libinput_event_pointer_get_dx ( struct libinput_event_pointer *  event)

Return the delta between the last event and the current event.

For pointer events that are not of type LIBINPUT_EVENT_POINTER_MOTION, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_POINTER_MOTION.
Returns
the relative x movement since the last event
double libinput_event_pointer_get_dy ( struct libinput_event_pointer *  event)

Return the delta between the last event and the current event.

For pointer events that are not of type LIBINPUT_EVENT_POINTER_MOTION, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_POINTER_MOTION.
Returns
the relative y movement since the last event
uint32_t libinput_event_pointer_get_seat_button_count ( struct libinput_event_pointer *  event)

For the button of a LIBINPUT_EVENT_POINTER_BUTTON event, return the total number of buttons pressed on all devices on the associated seat after the the event was triggered.

"

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_POINTER_BUTTON. For other events, this function returns 0.
Returns
the seat wide pressed button count for the key of this event
uint32_t libinput_event_pointer_get_time ( struct libinput_event_pointer *  event)
Returns
The event time for this event