Tablet events

Events that come from tools on tablet devices. For events from the pad, see Tablet pad events. More...

Data Structures

struct  libinput_event_tablet_tool
 

Functions

struct libinput_eventlibinput_event_tablet_tool_get_base_event (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_x_has_changed (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_y_has_changed (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_pressure_has_changed (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_distance_has_changed (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_tilt_x_has_changed (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_tilt_y_has_changed (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_rotation_has_changed (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_slider_has_changed (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_size_major_has_changed (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_size_minor_has_changed (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_wheel_has_changed (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_x (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_y (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_dx (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_dy (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_pressure (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_distance (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_tilt_x (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_tilt_y (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_rotation (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_slider_position (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_size_major (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_size_minor (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_wheel_delta (struct libinput_event_tablet_tool *event)
 
int libinput_event_tablet_tool_get_wheel_delta_discrete (struct libinput_event_tablet_tool *event)
 
double libinput_event_tablet_tool_get_x_transformed (struct libinput_event_tablet_tool *event, uint32_t width)
 
double libinput_event_tablet_tool_get_y_transformed (struct libinput_event_tablet_tool *event, uint32_t height)
 
struct libinput_tablet_toollibinput_event_tablet_tool_get_tool (struct libinput_event_tablet_tool *event)
 
enum libinput_tablet_tool_proximity_state libinput_event_tablet_tool_get_proximity_state (struct libinput_event_tablet_tool *event)
 
enum libinput_tablet_tool_tip_state libinput_event_tablet_tool_get_tip_state (struct libinput_event_tablet_tool *event)
 
uint32_t libinput_event_tablet_tool_get_button (struct libinput_event_tablet_tool *event)
 
enum libinput_button_state libinput_event_tablet_tool_get_button_state (struct libinput_event_tablet_tool *event)
 
uint32_t libinput_event_tablet_tool_get_seat_button_count (struct libinput_event_tablet_tool *event)
 
uint32_t libinput_event_tablet_tool_get_time (struct libinput_event_tablet_tool *event)
 
uint64_t libinput_event_tablet_tool_get_time_usec (struct libinput_event_tablet_tool *event)
 
enum libinput_tablet_tool_type libinput_tablet_tool_get_type (struct libinput_tablet_tool *tool)
 
uint64_t libinput_tablet_tool_get_tool_id (struct libinput_tablet_tool *tool)
 
struct libinput_tablet_toollibinput_tablet_tool_ref (struct libinput_tablet_tool *tool)
 
struct libinput_tablet_toollibinput_tablet_tool_unref (struct libinput_tablet_tool *tool)
 
int libinput_tablet_tool_has_pressure (struct libinput_tablet_tool *tool)
 
int libinput_tablet_tool_has_distance (struct libinput_tablet_tool *tool)
 
int libinput_tablet_tool_has_tilt (struct libinput_tablet_tool *tool)
 
int libinput_tablet_tool_has_rotation (struct libinput_tablet_tool *tool)
 
int libinput_tablet_tool_has_slider (struct libinput_tablet_tool *tool)
 
int libinput_tablet_tool_has_size (struct libinput_tablet_tool *tool)
 
int libinput_tablet_tool_has_wheel (struct libinput_tablet_tool *tool)
 
int libinput_tablet_tool_has_button (struct libinput_tablet_tool *tool, uint32_t code)
 
int libinput_tablet_tool_is_unique (struct libinput_tablet_tool *tool)
 
uint64_t libinput_tablet_tool_get_serial (struct libinput_tablet_tool *tool)
 
void * libinput_tablet_tool_get_user_data (struct libinput_tablet_tool *tool)
 
void libinput_tablet_tool_set_user_data (struct libinput_tablet_tool *tool, void *user_data)
 

Detailed Description

Events that come from tools on tablet devices. For events from the pad, see Tablet pad events.

Events from tablet devices are exposed by two interfaces, tools and pads. Tool events originate (usually) from a stylus-like device, pad events reflect any events originating from the physical tablet itself.

Note that many tablets support touch events. These are exposed through the LIBINPUT_DEVICE_CAP_POINTER interface (for external touchpad-like devices such as the Wacom Intuos series) or LIBINPUT_DEVICE_CAP_TOUCH interface (for built-in touchscreen-like devices such as the Wacom Cintiq series).

Function Documentation

◆ libinput_event_tablet_tool_distance_has_changed()

int libinput_event_tablet_tool_distance_has_changed ( struct libinput_event_tablet_tool event)

Check if the distance axis was updated in this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0. For tablet tool events of type LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function always returns 1.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
1 if the axis was updated or 0 otherwise
Since
1.2

◆ libinput_event_tablet_tool_get_base_event()

struct libinput_event* libinput_event_tablet_tool_get_base_event ( struct libinput_event_tablet_tool event)
Returns
The generic libinput_event of this event
Since
1.2

◆ libinput_event_tablet_tool_get_button()

uint32_t libinput_event_tablet_tool_get_button ( struct libinput_event_tablet_tool event)

Return the button that triggered this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_BUTTON, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
the button triggering this event
Since
1.2

◆ libinput_event_tablet_tool_get_button_state()

enum libinput_button_state libinput_event_tablet_tool_get_button_state ( struct libinput_event_tablet_tool 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_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
the button state triggering this event
Since
1.2

◆ libinput_event_tablet_tool_get_distance()

double libinput_event_tablet_tool_get_distance ( struct libinput_event_tablet_tool event)

Returns the current distance from the tablet's sensor, normalized to the range [0, 1].

If this axis does not exist on the current tool, this function returns 0.

Parameters
eventThe libinput tablet tool event
Returns
The current value of the the axis
Since
1.2

◆ libinput_event_tablet_tool_get_dx()

double libinput_event_tablet_tool_get_dx ( struct libinput_event_tablet_tool event)

Return the delta between the last event and the current event. If the tool employs pointer acceleration, the delta returned by this function is the accelerated delta.

This value is in screen coordinate space, the delta is to be interpreted like the return value of libinput_event_pointer_get_dx(). See the libinput documentation for more details.

Parameters
eventThe libinput tablet event
Returns
The relative x movement since the last event
Since
1.2

◆ libinput_event_tablet_tool_get_dy()

double libinput_event_tablet_tool_get_dy ( struct libinput_event_tablet_tool event)

Return the delta between the last event and the current event. If the tool employs pointer acceleration, the delta returned by this function is the accelerated delta.

This value is in screen coordinate space, the delta is to be interpreted like the return value of libinput_event_pointer_get_dx(). See the libinput documentation for more details.

Parameters
eventThe libinput tablet event
Returns
The relative y movement since the last event
Since
1.2

◆ libinput_event_tablet_tool_get_pressure()

double libinput_event_tablet_tool_get_pressure ( struct libinput_event_tablet_tool event)

Returns the current pressure being applied on the tool in use, normalized to the range [0, 1].

If this axis does not exist on the current tool, this function returns 0.

Parameters
eventThe libinput tablet tool event
Returns
The current value of the the axis
Since
1.2

◆ libinput_event_tablet_tool_get_proximity_state()

enum libinput_tablet_tool_proximity_state libinput_event_tablet_tool_get_proximity_state ( struct libinput_event_tablet_tool event)

Returns the new proximity state of a tool from a proximity event. Used to check whether or not a tool came in or out of proximity during an event of type LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY.

The proximity state represents the logical proximity state which does not necessarily match when a tool comes into sensor range or leaves the sensor range. On some tools this range does not represent the physical range but a reduced tool-specific logical range. If the range is reduced, this is done transparent to the caller.

For example, the Wacom mouse and lens cursor tools are usually used in relative mode, lying flat on the tablet. Movement typically follows the interaction normal mouse movements have, i.e. slightly lift the tool and place it in a separate location. The proximity detection on Wacom tablets however extends further than the user may lift the mouse, i.e. the tool may not be lifted out of physical proximity. For such tools, libinput provides software-emulated proximity.

Parameters
eventThe libinput tablet tool event
Returns
The new proximity state of the tool from the event.
Since
1.2

◆ libinput_event_tablet_tool_get_rotation()

double libinput_event_tablet_tool_get_rotation ( struct libinput_event_tablet_tool event)

Returns the current z rotation of the tool in degrees, clockwise from the tool's logical neutral position.

For tools of type LIBINPUT_TABLET_TOOL_TYPE_MOUSE and LIBINPUT_TABLET_TOOL_TYPE_LENS the logical neutral position is pointing to the current logical north of the tablet. For tools of type LIBINPUT_TABLET_TOOL_TYPE_BRUSH, the logical neutral position is with the buttons pointing up.

If this axis does not exist on the current tool, this function returns 0.

Parameters
eventThe libinput tablet tool event
Returns
The current value of the the axis
Since
1.2

◆ libinput_event_tablet_tool_get_seat_button_count()

uint32_t libinput_event_tablet_tool_get_seat_button_count ( struct libinput_event_tablet_tool event)

For the button of a LIBINPUT_EVENT_TABLET_TOOL_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_TOOL_BUTTON. For other events, this function returns 0.
Parameters
eventThe libinput tablet tool event
Returns
the seat wide pressed button count for the key of this event
Since
1.2

◆ libinput_event_tablet_tool_get_size_major()

double libinput_event_tablet_tool_get_size_major ( struct libinput_event_tablet_tool event)

Returns the current size in mm along the major axis of the touching ellipse. This axis is not necessarily aligned with either x or y, the rotation must be taken into account.

Where no rotation is available on a tool, or where rotation is zero, the major axis aligns with the y axis and the minor axis with the x axis.

If this axis does not exist on the current tool, this function returns 0.

Parameters
eventThe libinput tablet tool event
Returns
The current value of the axis major in mm

◆ libinput_event_tablet_tool_get_size_minor()

double libinput_event_tablet_tool_get_size_minor ( struct libinput_event_tablet_tool event)

Returns the current size in mm along the minor axis of the touching ellipse. This axis is not necessarily aligned with either x or y, the rotation must be taken into account.

Where no rotation is available on a tool, or where rotation is zero, the minor axis aligns with the y axis and the minor axis with the x axis.

If this axis does not exist on the current tool, this function returns 0.

Parameters
eventThe libinput tablet tool event
Returns
The current value of the axis minor in mm

◆ libinput_event_tablet_tool_get_slider_position()

double libinput_event_tablet_tool_get_slider_position ( struct libinput_event_tablet_tool event)

Returns the current position of the slider on the tool, normalized to the range [-1, 1]. The logical zero is the neutral position of the slider, or the logical center of the axis. This axis is available on e.g. the Wacom Airbrush.

If this axis does not exist on the current tool, this function returns 0.

Parameters
eventThe libinput tablet tool event
Returns
The current value of the the axis
Since
1.2

◆ libinput_event_tablet_tool_get_tilt_x()

double libinput_event_tablet_tool_get_tilt_x ( struct libinput_event_tablet_tool event)

Returns the current tilt along the X axis of the tablet's current logical orientation, in degrees off the tablet's z axis. That is, if the tool is perfectly orthogonal to the tablet, the tilt angle is 0. When the top tilts towards the logical top/left of the tablet, the x/y tilt angles are negative, if the top tilts towards the logical bottom/right of the tablet, the x/y tilt angles are positive.

If this axis does not exist on the current tool, this function returns 0.

Parameters
eventThe libinput tablet tool event
Returns
The current value of the axis in degrees
Since
1.2

◆ libinput_event_tablet_tool_get_tilt_y()

double libinput_event_tablet_tool_get_tilt_y ( struct libinput_event_tablet_tool event)

Returns the current tilt along the Y axis of the tablet's current logical orientation, in degrees off the tablet's z axis. That is, if the tool is perfectly orthogonal to the tablet, the tilt angle is 0. When the top tilts towards the logical top/left of the tablet, the x/y tilt angles are negative, if the top tilts towards the logical bottom/right of the tablet, the x/y tilt angles are positive.

If this axis does not exist on the current tool, this function returns 0.

Parameters
eventThe libinput tablet tool event
Returns
The current value of the the axis in degrees
Since
1.2

◆ libinput_event_tablet_tool_get_time()

uint32_t libinput_event_tablet_tool_get_time ( struct libinput_event_tablet_tool event)
Note
Timestamps may not always increase. See the libinput documentation for more details.
Parameters
eventThe libinput tablet tool event
Returns
The event time for this event
Since
1.2

◆ libinput_event_tablet_tool_get_time_usec()

uint64_t libinput_event_tablet_tool_get_time_usec ( struct libinput_event_tablet_tool event)
Note
Timestamps may not always increase. See the libinput documentation for more details.
Parameters
eventThe libinput tablet tool event
Returns
The event time for this event in microseconds
Since
1.2

◆ libinput_event_tablet_tool_get_tip_state()

enum libinput_tablet_tool_tip_state libinput_event_tablet_tool_get_tip_state ( struct libinput_event_tablet_tool event)

Returns the new tip state of a tool from a tip event. Used to check whether or not a tool came in contact with the tablet surface or left contact with the tablet surface during an event of type LIBINPUT_EVENT_TABLET_TOOL_TIP.

Parameters
eventThe libinput tablet tool event
Returns
The new tip state of the tool from the event.
Since
1.2

◆ libinput_event_tablet_tool_get_tool()

struct libinput_tablet_tool* libinput_event_tablet_tool_get_tool ( struct libinput_event_tablet_tool event)

Returns the tool that was in use during this event.

The returned tablet tool is not refcounted and may become invalid after the next call to libinput. Use libinput_tablet_tool_ref() and libinput_tablet_tool_unref() to continue using the handle outside of the immediate scope.

If the caller holds at least one reference, this struct is used whenever the tools enters proximity again.

Note
Physical tool tracking requires hardware support. If unavailable, libinput creates one tool per type per tablet. See libinput_tablet_tool_get_serial() for more details.
Parameters
eventThe libinput tablet tool event
Returns
The new tool triggering this event
Since
1.2

◆ libinput_event_tablet_tool_get_wheel_delta()

double libinput_event_tablet_tool_get_wheel_delta ( struct libinput_event_tablet_tool event)

Return the delta for the wheel in degrees.

Parameters
eventThe libinput tablet tool event
Returns
The delta of the wheel, in degrees, compared to the last event
See also
libinput_event_tablet_tool_get_wheel_delta_discrete

◆ libinput_event_tablet_tool_get_wheel_delta_discrete()

int libinput_event_tablet_tool_get_wheel_delta_discrete ( struct libinput_event_tablet_tool event)

Return the delta for the wheel in discrete steps (e.g. wheel clicks).

Parameters
eventThe libinput tablet tool event
Returns
The delta of the wheel, in discrete steps, compared to the last event
See also
libinput_event_tablet_tool_get_wheel_delta_discrete
Since
1.2

◆ libinput_event_tablet_tool_get_x()

double libinput_event_tablet_tool_get_x ( struct libinput_event_tablet_tool event)

Returns the X coordinate of the tablet tool, in mm from the top left corner of the tablet in its current logical orientation. Use libinput_event_tablet_tool_get_x_transformed() for transforming the axis value into a different coordinate space.

Note
On some devices, returned value may be negative or larger than the width of the device. See the libinput documentation for more details.
Parameters
eventThe libinput tablet tool event
Returns
The current value of the the axis
Since
1.2

◆ libinput_event_tablet_tool_get_x_transformed()

double libinput_event_tablet_tool_get_x_transformed ( struct libinput_event_tablet_tool event,
uint32_t  width 
)

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

Note
This function may be called for a specific axis even if libinput_event_tablet_tool_*_has_changed() returns 0 for that axis. libinput always includes all device axes in the event.
On some devices, returned value may be negative or larger than the width of the device. See the libinput documentation for more details.
Parameters
eventThe libinput tablet tool event
widthThe current output screen width
Returns
the current absolute x coordinate transformed to a screen coordinate
Since
1.2

◆ libinput_event_tablet_tool_get_y()

double libinput_event_tablet_tool_get_y ( struct libinput_event_tablet_tool event)

Returns the Y coordinate of the tablet tool, in mm from the top left corner of the tablet in its current logical orientation. Use libinput_event_tablet_tool_get_y_transformed() for transforming the axis value into a different coordinate space.

Note
On some devices, returned value may be negative or larger than the width of the device. See the libinput documentation for more details.
Parameters
eventThe libinput tablet tool event
Returns
The current value of the the axis
Since
1.2

◆ libinput_event_tablet_tool_get_y_transformed()

double libinput_event_tablet_tool_get_y_transformed ( struct libinput_event_tablet_tool event,
uint32_t  height 
)

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

Note
This function may be called for a specific axis even if libinput_event_tablet_tool_*_has_changed() returns 0 for that axis. libinput always includes all device axes in the event.
On some devices, returned value may be negative or larger than the width of the device. See the libinput documentation for more details.
Parameters
eventThe libinput tablet tool event
heightThe current output screen height
Returns
the current absolute y coordinate transformed to a screen coordinate
Since
1.2

◆ libinput_event_tablet_tool_pressure_has_changed()

int libinput_event_tablet_tool_pressure_has_changed ( struct libinput_event_tablet_tool event)

Check if the pressure axis was updated in this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
1 if the axis was updated or 0 otherwise
Since
1.2

◆ libinput_event_tablet_tool_rotation_has_changed()

int libinput_event_tablet_tool_rotation_has_changed ( struct libinput_event_tablet_tool event)

Check if the z-rotation axis was updated in this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
1 if the axis was updated or 0 otherwise
Since
1.2

◆ libinput_event_tablet_tool_size_major_has_changed()

int libinput_event_tablet_tool_size_major_has_changed ( struct libinput_event_tablet_tool event)

Check if the size major axis was updated in this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
1 if the axis was updated or 0 otherwise

◆ libinput_event_tablet_tool_size_minor_has_changed()

int libinput_event_tablet_tool_size_minor_has_changed ( struct libinput_event_tablet_tool event)

Check if the size minor axis was updated in this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
1 if the axis was updated or 0 otherwise

◆ libinput_event_tablet_tool_slider_has_changed()

int libinput_event_tablet_tool_slider_has_changed ( struct libinput_event_tablet_tool event)

Check if the slider axis was updated in this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
1 if the axis was updated or 0 otherwise
Since
1.2

◆ libinput_event_tablet_tool_tilt_x_has_changed()

int libinput_event_tablet_tool_tilt_x_has_changed ( struct libinput_event_tablet_tool event)

Check if the tilt x axis was updated in this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
1 if the axis was updated or 0 otherwise
Since
1.2

◆ libinput_event_tablet_tool_tilt_y_has_changed()

int libinput_event_tablet_tool_tilt_y_has_changed ( struct libinput_event_tablet_tool event)

Check if the tilt y axis was updated in this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
1 if the axis was updated or 0 otherwise
Since
1.2

◆ libinput_event_tablet_tool_wheel_has_changed()

int libinput_event_tablet_tool_wheel_has_changed ( struct libinput_event_tablet_tool event)

Check if the wheel axis was updated in this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
1 if the axis was updated or 0 otherwise
Since
1.2

◆ libinput_event_tablet_tool_x_has_changed()

int libinput_event_tablet_tool_x_has_changed ( struct libinput_event_tablet_tool event)

Check if the x axis was updated in this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
1 if the axis was updated or 0 otherwise
Since
1.2

◆ libinput_event_tablet_tool_y_has_changed()

int libinput_event_tablet_tool_y_has_changed ( struct libinput_event_tablet_tool event)

Check if the y axis was updated in this event. For events that are not of type LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, this function returns 0.

Note
It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_TOOL_AXIS, LIBINPUT_EVENT_TABLET_TOOL_TIP, or LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, or LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
Parameters
eventThe libinput tablet tool event
Returns
1 if the axis was updated or 0 otherwise
Since
1.2

◆ libinput_tablet_tool_get_serial()

uint64_t libinput_tablet_tool_get_serial ( struct libinput_tablet_tool tool)

Return the serial number of a tool. If the tool does not report a serial number, this function returns zero.

Some tools provide hardware information that enables libinput to uniquely identify the physical device. For example, tools compatible with the Wacom Intuos 4, Intuos 5, Intuos Pro and Cintiq series are uniquely identifiable through a serial number. libinput does not specify how a tool can be identified uniquely, a caller should use libinput_tablet_tool_is_unique() to check if the tool is unique.

libinput creates a struct libinput_tablet_tool on the first proximity in of this tool. By default, this struct is destroyed on proximity out and re-initialized on the next proximity in. If a caller keeps a reference to the tool by using libinput_tablet_tool_ref() libinput re-uses this struct whenever that same physical tool comes into proximity on any tablet recognized by libinput. It is possible to attach tool-specific virtual state to the tool. For example, a graphics program such as the GIMP may assign a specific color to each tool, allowing the artist to use the tools like physical pens of different color. In multi-tablet setups it is also possible to track the tool across devices.

If the tool does not have a unique identifier, libinput creates a single struct libinput_tablet_tool per tool type on each tablet the tool is used on.

Parameters
toolThe libinput tool
Returns
The tool serial number
See also
libinput_tablet_tool_is_unique
Since
1.2

◆ libinput_tablet_tool_get_tool_id()

uint64_t libinput_tablet_tool_get_tool_id ( struct libinput_tablet_tool tool)

Return the tool ID for a tool object. If nonzero, this number identifies the specific type of the tool with more precision than the type returned in libinput_tablet_tool_get_type(). Not all tablets support a tool ID.

Tablets known to support tool IDs include the Wacom Intuos 3, 4, 5, Wacom Cintiq and Wacom Intuos Pro series. The tool ID can be used to distinguish between e.g. a Wacom Classic Pen or a Wacom Pro Pen. It is the caller's responsibility to interpret the tool ID.

Parameters
toolThe libinput tool
Returns
The tool ID for this tool object or 0 if none is provided
See also
libinput_tablet_tool_get_type
Since
1.2

◆ libinput_tablet_tool_get_type()

enum libinput_tablet_tool_type libinput_tablet_tool_get_type ( struct libinput_tablet_tool tool)

Return the high-level tool type for a tool object.

The high level tool describes general interaction expected with the tool. For example, a user would expect a tool of type LIBINPUT_TABLET_TOOL_TYPE_PEN to interact with a graphics application taking pressure and tilt into account. The default virtual tool assigned should be a drawing tool, e.g. a virtual pen or brush. A tool of type LIBINPUT_TABLET_TOOL_TYPE_ERASER would normally be mapped to an eraser-like virtual tool.

If supported by the hardware, a more specific tool id is always available, see libinput_tablet_tool_get_tool_id().

Parameters
toolThe libinput tool
Returns
The tool type for this tool object
See also
libinput_tablet_tool_get_tool_id
Since
1.2

◆ libinput_tablet_tool_get_user_data()

void* libinput_tablet_tool_get_user_data ( struct libinput_tablet_tool tool)

Return the user data associated with a tool object. libinput does not manage, look at, or modify this data. The caller must ensure the data is valid.

Parameters
toolThe libinput tool
Returns
The user data associated with the tool object
Since
1.2

◆ libinput_tablet_tool_has_button()

int libinput_tablet_tool_has_button ( struct libinput_tablet_tool tool,
uint32_t  code 
)

Check if a tablet tool has a button with the passed-in code (see linux/input.h).

Parameters
toolA tablet tool
codebutton code to check for
Returns
1 if the tool supports this button code, 0 if it does not
Since
1.2

◆ libinput_tablet_tool_has_distance()

int libinput_tablet_tool_has_distance ( struct libinput_tablet_tool tool)

Return whether the tablet tool supports distance.

Parameters
toolThe tool to check the axis capabilities of
Returns
Nonzero if the axis is available, zero otherwise.
Since
1.2

◆ libinput_tablet_tool_has_pressure()

int libinput_tablet_tool_has_pressure ( struct libinput_tablet_tool tool)

Return whether the tablet tool supports pressure.

Parameters
toolThe tool to check the axis capabilities of
Returns
Nonzero if the axis is available, zero otherwise.
Since
1.2

◆ libinput_tablet_tool_has_rotation()

int libinput_tablet_tool_has_rotation ( struct libinput_tablet_tool tool)

Return whether the tablet tool supports z-rotation.

Parameters
toolThe tool to check the axis capabilities of
Returns
Nonzero if the axis is available, zero otherwise.
Since
1.2

◆ libinput_tablet_tool_has_size()

int libinput_tablet_tool_has_size ( struct libinput_tablet_tool tool)

Return whether the tablet tool has a ellipsis major and minor. Where the underlying hardware only supports one of either major or minor, libinput emulates the other axis as a circular contact, i.e. major == minor for all values of major.

Parameters
toolThe tool to check the axis capabilities of
Returns
Nonzero if the axis is available, zero otherwise.

◆ libinput_tablet_tool_has_slider()

int libinput_tablet_tool_has_slider ( struct libinput_tablet_tool tool)

Return whether the tablet tool has a slider axis.

Parameters
toolThe tool to check the axis capabilities of
Returns
Nonzero if the axis is available, zero otherwise.
Since
1.2

◆ libinput_tablet_tool_has_tilt()

int libinput_tablet_tool_has_tilt ( struct libinput_tablet_tool tool)

Return whether the tablet tool supports tilt.

Parameters
toolThe tool to check the axis capabilities of
Returns
Nonzero if the axis is available, zero otherwise.
Since
1.2

◆ libinput_tablet_tool_has_wheel()

int libinput_tablet_tool_has_wheel ( struct libinput_tablet_tool tool)

Return whether the tablet tool has a relative wheel.

Parameters
toolThe tool to check the axis capabilities of
Returns
Nonzero if the axis is available, zero otherwise.
Since
1.2

◆ libinput_tablet_tool_is_unique()

int libinput_tablet_tool_is_unique ( struct libinput_tablet_tool tool)

Return nonzero if the physical tool can be uniquely identified by libinput, or nonzero otherwise. If a tool can be uniquely identified, keeping a reference to the tool allows tracking the tool across proximity out sequences and across compatible tablets. See libinput_tablet_tool_get_serial() for more details.

Parameters
toolA tablet tool
Returns
1 if the tool can be uniquely identified, 0 otherwise.
See also
libinput_tablet_tool_get_serial
Since
1.2

◆ libinput_tablet_tool_ref()

struct libinput_tablet_tool* libinput_tablet_tool_ref ( struct libinput_tablet_tool tool)

Increment the reference count of the tool by one. A tool is destroyed whenever the reference count reaches 0. See libinput_tablet_tool_unref().

Parameters
toolThe tool to increment the ref count of
Returns
The passed tool
See also
libinput_tablet_tool_unref
Since
1.2

◆ libinput_tablet_tool_set_user_data()

void libinput_tablet_tool_set_user_data ( struct libinput_tablet_tool tool,
void *  user_data 
)

Set the user data associated with a tool object, if any.

Parameters
toolThe libinput tool
user_dataThe user data to associate with the tool object
Since
1.2

◆ libinput_tablet_tool_unref()

struct libinput_tablet_tool* libinput_tablet_tool_unref ( struct libinput_tablet_tool tool)

Decrement the reference count of the tool by one. When the reference count of the tool reaches 0, the memory allocated for the tool will be freed.

Parameters
toolThe tool to decrement the ref count of
Returns
NULL if the tool was destroyed otherwise the passed tool
See also
libinput_tablet_tool_ref
Since
1.2