libinput  0.1.0
A wrapper library for input devices
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
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)
 
li_fixed_t libinput_event_pointer_get_dx (struct libinput_event_pointer *event)
 Return the delta between the last event and the current event. More...
 
li_fixed_t libinput_event_pointer_get_dy (struct libinput_event_pointer *event)
 Return the delta between the last event and the current event. More...
 
li_fixed_t libinput_event_pointer_get_absolute_x (struct libinput_event_pointer *event)
 Return the current absolute x coordinate of the pointer event. More...
 
li_fixed_t libinput_event_pointer_get_absolute_y (struct libinput_event_pointer *event)
 Return the current absolute y coordinate of the pointer event. More...
 
li_fixed_t 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...
 
li_fixed_t 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_pointer_button_state libinput_event_pointer_get_button_state (struct libinput_event_pointer *event)
 Return the button state that triggered this event. More...
 
enum libinput_pointer_axis libinput_event_pointer_get_axis (struct libinput_event_pointer *event)
 Return the axis that triggered this event. More...
 
li_fixed_t libinput_event_pointer_get_axis_value (struct libinput_event_pointer *event)
 Return the axis value of the given axis. More...
 

Detailed Description

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

Function Documentation

li_fixed_t libinput_event_pointer_get_absolute_x ( struct libinput_event_pointer *  event)

Return the current absolute x coordinate of the pointer event.

The coordinate is in a device specific coordinate space; 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
li_fixed_t 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
li_fixed_t libinput_event_pointer_get_absolute_y ( struct libinput_event_pointer *  event)

Return the current absolute y coordinate of the pointer event.

The coordinate is in a device specific coordinate space; to get the corresponding output screen coordinate, use libinput_event_pointer_get_y_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
li_fixed_t 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
li_fixed_t 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_VERTICAL_SCROLL and LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL, 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
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_pointer_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
li_fixed_t 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
li_fixed_t 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_time ( struct libinput_event_pointer *  event)
Returns
The event time for this event