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

Events that come from tablet devices. More...

Data Structures

struct  libinput_event_tablet
 Tablet event representing an axis update, button press, or tool update. More...
 

Functions

int libinput_event_tablet_axis_has_changed (struct libinput_event_tablet *event, enum libinput_tablet_axis axis)
 Checks if an axis was updated in this event or return 0 otherwise. More...
 
double libinput_event_tablet_get_axis_value (struct libinput_event_tablet *event, enum libinput_tablet_axis axis)
 Return the axis value of a given axis for a tablet. More...
 
double libinput_event_tablet_get_x_transformed (struct libinput_event_tablet *event, uint32_t width)
 Return the current absolute x coordinate of the tablet event, transformed to screen coordinates. More...
 
double libinput_event_tablet_get_y_transformed (struct libinput_event_tablet *event, uint32_t height)
 Return the current absolute y coordinate of the tablet event, transformed to screen coordinates. More...
 
struct libinput_tool * libinput_event_tablet_get_tool (struct libinput_event_tablet *event)
 Return the new tool in use for this event. More...
 
uint32_t libinput_event_tablet_get_button (struct libinput_event_tablet *event)
 Return the button that triggered this event. More...
 
enum libinput_button_state libinput_event_tablet_get_button_state (struct libinput_event_tablet *event)
 Return the button state of the event. More...
 
uint32_t libinput_event_tablet_get_seat_button_count (struct libinput_event_tablet *event)
 For the button of a LIBINPUT_EVENT_TABLET_BUTTON event, return the total number of buttons pressed on all devices on the associated seat after the the event was triggered. More...
 
uint32_t libinput_event_tablet_get_time (struct libinput_event_tablet *event)
 
enum libinput_tool_type libinput_tool_get_type (struct libinput_tool *tool)
 Return the type of tool type for a tool object. More...
 
void libinput_tool_ref (struct libinput_tool *tool)
 Increment the ref count of tool by one. More...
 
void libinput_tool_unref (struct libinput_tool *tool)
 Decrement the ref count of tool by one. More...
 
uint32_t libinput_tool_get_serial (struct libinput_tool *tool)
 Return the serial number of a tool. More...
 

Detailed Description

Events that come from tablet devices.

Function Documentation

int libinput_event_tablet_axis_has_changed ( struct libinput_event_tablet event,
enum libinput_tablet_axis  axis 
)

Checks if an axis was updated in this event or return 0 otherwise.

For tablet events that are not of type LIBINPUT_EVENT_TABLET_AXIS, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_AXIS.
Parameters
eventThe libinput tablet event
axisThe axis to check for updates
Returns
1 if the axis was updated or 0 otherwise
double libinput_event_tablet_get_axis_value ( struct libinput_event_tablet event,
enum libinput_tablet_axis  axis 
)

Return the axis value of a given axis for a tablet.

The interpretation of the value is as follows:

For tablet events that are not of type LIBINPUT_EVENT_TABLET_AXIS or LIBINPUT_EVENT_TABLET_AXIS_RELATIVE, this function returns 0.

Parameters
eventThe libinput tablet event
axisThe axis to retrieve the value of
Returns
The current value of the the axis
uint32_t libinput_event_tablet_get_button ( struct libinput_event_tablet event)

Return the button that triggered this event.

For tablet events that are not of type LIBINPUT_EVENT_TABLET_BUTTON, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_BUTTON.
Parameters
eventThe libinput tablet event
Returns
the button triggering this event
enum libinput_button_state libinput_event_tablet_get_button_state ( struct libinput_event_tablet event)

Return the button state of the event.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_BUTTON.
Parameters
eventThe libinput tablet event
Returns
the button state triggering this event
uint32_t libinput_event_tablet_get_seat_button_count ( struct libinput_event_tablet event)

For the button of a LIBINPUT_EVENT_TABLET_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_TABLET_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_tablet_get_time ( struct libinput_event_tablet event)
Parameters
eventThe libinput tablet event
Returns
The event time for this event
struct libinput_tool* libinput_event_tablet_get_tool ( struct libinput_event_tablet event)

Return the new tool in use for this event.

For tablet events that are not of type LIBINPUT_EVENT_TABLET_TOOL_UPDATE, this function returns NULL. By default, the lifetime of each tool is bound to the lifetime of the event, so the tool will be destroyed when the event is destroyed. However, the lifetime of the tool may be extended by using libinput_tool_ref() to increment the reference count of the tool. Whenever libinput detects that the tool is in proximity of any tablet that's connected, it will return the same libinput_tool object.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_UPDATE.
On tablets where the serial number of tools is not reported, each tool cannot be guaranteed to be unique.
Parameters
eventThe libinput tablet event
Returns
The new tool triggering this event
double libinput_event_tablet_get_x_transformed ( struct libinput_event_tablet event,
uint32_t  width 
)

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

Parameters
eventThe libinput tablet event
widthThe current output screen width
Returns
the current absolute x coordinate transformed to a screen coordinate
double libinput_event_tablet_get_y_transformed ( struct libinput_event_tablet event,
uint32_t  height 
)

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

Parameters
eventThe libinput tablet event
heightThe current output screen height
Returns
the current absolute y coordinate transformed to a screen coordinate
uint32_t libinput_tool_get_serial ( struct libinput_tool *  tool)

Return the serial number of a tool.

Note
Not all tablets report a serial number along with the type of tool being used. If the hardware does not provide a unique serial number, the serial number is always 0.
Parameters
toolThe libinput tool
Returns
The new tool serial triggering this event
enum libinput_tool_type libinput_tool_get_type ( struct libinput_tool *  tool)

Return the type of tool type for a tool object.

Parameters
toolThe libinput tool
Returns
The tool type for this tool object
void libinput_tool_ref ( struct libinput_tool *  tool)

Increment the ref count of tool by one.

Parameters
toolThe tool to increment the ref count of
void libinput_tool_unref ( struct libinput_tool *  tool)

Decrement the ref count of tool by one.

When the ref count of tool reaches 0, the memory allocated for tool will be freed.

Parameters
toolThe tool to decrement the ref count of