Events that come from tools on or the pad of tablet devices. More...
Data Structures | |
struct | libinput_event_tablet_tool |
Tablet tool event representing an axis update, button press, or tool update. More... | |
struct | libinput_event_tablet_pad |
Tablet pad event representing a button press, or ring/strip update on the tablet pad itself. More... | |
Enumerations | |
enum | libinput_tablet_pad_ring_axis_source { LIBINPUT_TABLET_PAD_RING_SOURCE_UNKNOWN, LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER } |
The source for a LIBINPUT_EVENT_TABLET_PAD_RING event. More... | |
enum | libinput_tablet_pad_strip_axis_source { LIBINPUT_TABLET_PAD_STRIP_SOURCE_UNKNOWN, LIBINPUT_TABLET_PAD_STRIP_SOURCE_FINGER } |
The source for a LIBINPUT_EVENT_TABLET_PAD_STRIP event. More... | |
Functions | |
struct libinput_event * | libinput_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) |
Check if the x axis was updated in this event. More... | |
int | libinput_event_tablet_tool_y_has_changed (struct libinput_event_tablet_tool *event) |
Check if the y axis was updated in this event. More... | |
int | libinput_event_tablet_tool_pressure_has_changed (struct libinput_event_tablet_tool *event) |
Check if the pressure axis was updated in this event. More... | |
int | libinput_event_tablet_tool_distance_has_changed (struct libinput_event_tablet_tool *event) |
Check if the distance axis was updated in this event. More... | |
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. More... | |
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. More... | |
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. More... | |
int | libinput_event_tablet_tool_slider_has_changed (struct libinput_event_tablet_tool *event) |
Check if the slider axis was updated in this event. More... | |
int | libinput_event_tablet_tool_wheel_has_changed (struct libinput_event_tablet_tool *event) |
Check if the wheel axis was updated in this event. More... | |
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. More... | |
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. More... | |
double | libinput_event_tablet_tool_get_dx (struct libinput_event_tablet_tool *event) |
Return the delta between the last event and the current event. More... | |
double | libinput_event_tablet_tool_get_dy (struct libinput_event_tablet_tool *event) |
Return the delta between the last event and the current event. More... | |
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]. More... | |
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]. More... | |
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. More... | |
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. More... | |
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. More... | |
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]. More... | |
double | libinput_event_tablet_tool_get_wheel_delta (struct libinput_event_tablet_tool *event) |
Return the delta for the wheel in degrees. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
uint32_t | libinput_event_tablet_tool_get_button (struct libinput_event_tablet_tool *event) |
Return the button that triggered this event. More... | |
enum libinput_button_state | libinput_event_tablet_tool_get_button_state (struct libinput_event_tablet_tool *event) |
Return the button state of the event. More... | |
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. More... | |
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) |
Return the tool type for a tool object, see Vendor-specific tablet tool types for details. More... | |
uint64_t | libinput_tablet_tool_get_tool_id (struct libinput_tablet_tool *tool) |
Return the tool ID for a tool object. More... | |
struct libinput_tablet_tool * | libinput_tablet_tool_ref (struct libinput_tablet_tool *tool) |
Increment the reference count of the tool by one. More... | |
struct libinput_tablet_tool * | libinput_tablet_tool_unref (struct libinput_tablet_tool *tool) |
Decrement the reference count of the tool by one. More... | |
int | libinput_tablet_tool_has_pressure (struct libinput_tablet_tool *tool) |
Return whether the tablet tool supports pressure. More... | |
int | libinput_tablet_tool_has_distance (struct libinput_tablet_tool *tool) |
Return whether the tablet tool supports distance. More... | |
int | libinput_tablet_tool_has_tilt (struct libinput_tablet_tool *tool) |
Return whether the tablet tool supports tilt. More... | |
int | libinput_tablet_tool_has_rotation (struct libinput_tablet_tool *tool) |
Return whether the tablet tool supports z-rotation. More... | |
int | libinput_tablet_tool_has_slider (struct libinput_tablet_tool *tool) |
Return whether the tablet tool has a slider axis. More... | |
int | libinput_tablet_tool_has_wheel (struct libinput_tablet_tool *tool) |
Return whether the tablet tool has a relative wheel. More... | |
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). More... | |
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. More... | |
uint64_t | libinput_tablet_tool_get_serial (struct libinput_tablet_tool *tool) |
Return the serial number of a tool. More... | |
void * | libinput_tablet_tool_get_user_data (struct libinput_tablet_tool *tool) |
Return the user data associated with a tool object. More... | |
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. More... | |
struct libinput_event * | libinput_event_tablet_pad_get_base_event (struct libinput_event_tablet_pad *event) |
double | libinput_event_tablet_pad_get_ring_position (struct libinput_event_tablet_pad *event) |
Returns the current position of the ring, in degrees counterclockwise from the northern-most point of the ring in the tablet's current logical orientation. More... | |
unsigned int | libinput_event_tablet_pad_get_ring_number (struct libinput_event_tablet_pad *event) |
Returns the number of the ring that has changed state, with 0 being the first ring. More... | |
enum libinput_tablet_pad_ring_axis_source | libinput_event_tablet_pad_get_ring_source (struct libinput_event_tablet_pad *event) |
Returns the source of the interaction with the ring. More... | |
double | libinput_event_tablet_pad_get_strip_position (struct libinput_event_tablet_pad *event) |
Returns the current position of the strip, normalized to the range [0, 1], with 0 being the top/left-most point in the tablet's current logical orientation. More... | |
unsigned int | libinput_event_tablet_pad_get_strip_number (struct libinput_event_tablet_pad *event) |
Returns the number of the strip that has changed state, with 0 being the first strip. More... | |
enum libinput_tablet_pad_strip_axis_source | libinput_event_tablet_pad_get_strip_source (struct libinput_event_tablet_pad *event) |
Returns the source of the interaction with the strip. More... | |
uint32_t | libinput_event_tablet_pad_get_button_number (struct libinput_event_tablet_pad *event) |
Return the button number that triggered this event, starting at 0. More... | |
enum libinput_button_state | libinput_event_tablet_pad_get_button_state (struct libinput_event_tablet_pad *event) |
Return the button state of the event. More... | |
uint32_t | libinput_event_tablet_pad_get_time (struct libinput_event_tablet_pad *event) |
uint64_t | libinput_event_tablet_pad_get_time_usec (struct libinput_event_tablet_pad *event) |
Detailed Description
Events that come from tools on or the pad of tablet devices.
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).
Enumeration Type Documentation
The source for a LIBINPUT_EVENT_TABLET_PAD_RING event.
See libinput_event_tablet_pad_get_ring_source() for details.
Enumerator | |
---|---|
LIBINPUT_TABLET_PAD_RING_SOURCE_UNKNOWN | |
LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER |
The event is caused by the movement of one or more fingers on the ring. |
The source for a LIBINPUT_EVENT_TABLET_PAD_STRIP event.
See libinput_event_tablet_pad_get_strip_source() for details.
Enumerator | |
---|---|
LIBINPUT_TABLET_PAD_STRIP_SOURCE_UNKNOWN | |
LIBINPUT_TABLET_PAD_STRIP_SOURCE_FINGER |
The event is caused by the movement of one or more fingers on the strip. |
Function Documentation
struct libinput_event* libinput_event_tablet_pad_get_base_event | ( | struct libinput_event_tablet_pad * | event | ) |
- Returns
- The generic libinput_event of this event
uint32_t libinput_event_tablet_pad_get_button_number | ( | struct libinput_event_tablet_pad * | event | ) |
Return the button number that triggered this event, starting at 0.
For events that are not of type LIBINPUT_EVENT_TABLET_PAD_BUTTON, this function returns 0.
Note that the number returned is a generic sequential button number and not a semantic button code as defined in linux/input.h. See Tablet pad button numbers for more details.
- Note
- It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_PAD_BUTTON. For other events, this function returns 0.
- Parameters
-
event The libinput tablet pad event
- Returns
- the button triggering this event
enum libinput_button_state libinput_event_tablet_pad_get_button_state | ( | struct libinput_event_tablet_pad * | 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_PAD_BUTTON. For other events, this function returns 0.
- Parameters
-
event The libinput tablet pad event
- Returns
- the button state triggering this event
unsigned int libinput_event_tablet_pad_get_ring_number | ( | struct libinput_event_tablet_pad * | event | ) |
Returns the number of the ring that has changed state, with 0 being the first ring.
On tablets with only one ring, this function always returns 0.
- Note
- It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_PAD_RING. For other events, this function returns 0.
- Parameters
-
event The libinput tablet pad event
- Returns
- The index of the ring that changed state
double libinput_event_tablet_pad_get_ring_position | ( | struct libinput_event_tablet_pad * | event | ) |
Returns the current position of the ring, in degrees counterclockwise from the northern-most point of the ring in the tablet's current logical orientation.
If the source is LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER, libinput sends a terminating event with a ring value of -1 when the finger is lifted from the ring. A caller may use this information to e.g. determine if kinetic scrolling should be triggered.
- Note
- It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_PAD_RING. For other events, this function returns 0.
- Parameters
-
event The libinput tablet pad event
- Returns
- The current value of the the axis
- Return values
-
-1 The finger was lifted
enum libinput_tablet_pad_ring_axis_source libinput_event_tablet_pad_get_ring_source | ( | struct libinput_event_tablet_pad * | event | ) |
Returns the source of the interaction with the ring.
If the source is LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER, libinput sends a ring position value of -1 to terminate the current interaction.
- Note
- It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_PAD_RING. For other events, this function returns 0.
- Parameters
-
event The libinput tablet pad event
- Returns
- The source of the ring interaction
unsigned int libinput_event_tablet_pad_get_strip_number | ( | struct libinput_event_tablet_pad * | event | ) |
Returns the number of the strip that has changed state, with 0 being the first strip.
On tablets with only one strip, this function always returns 0.
- Note
- It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_PAD_STRIP. For other events, this function returns 0.
- Parameters
-
event The libinput tablet pad event
- Returns
- The index of the strip that changed state
double libinput_event_tablet_pad_get_strip_position | ( | struct libinput_event_tablet_pad * | event | ) |
Returns the current position of the strip, normalized to the range [0, 1], with 0 being the top/left-most point in the tablet's current logical orientation.
If the source is LIBINPUT_TABLET_PAD_STRIP_SOURCE_FINGER, libinput sends a terminating event with a ring value of -1 when the finger is lifted from the ring. A caller may use this information to e.g. determine if kinetic scrolling should be triggered.
- Note
- It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_PAD_STRIP. For other events, this function returns 0.
- Parameters
-
event The libinput tablet pad event
- Returns
- The current value of the the axis
- Return values
-
-1 The finger was lifted
enum libinput_tablet_pad_strip_axis_source libinput_event_tablet_pad_get_strip_source | ( | struct libinput_event_tablet_pad * | event | ) |
Returns the source of the interaction with the strip.
If the source is LIBINPUT_TABLET_PAD_STRIP_SOURCE_FINGER, libinput sends a strip position value of -1 to terminate the current interaction.
- Note
- It is an application bug to call this function for events other than LIBINPUT_EVENT_TABLET_PAD_STRIP. For other events, this function returns 0.
- Parameters
-
event The libinput tablet pad event
- Returns
- The source of the strip interaction
uint32_t libinput_event_tablet_pad_get_time | ( | struct libinput_event_tablet_pad * | event | ) |
- Parameters
-
event The libinput tablet pad event
- Returns
- The event time for this event
uint64_t libinput_event_tablet_pad_get_time_usec | ( | struct libinput_event_tablet_pad * | event | ) |
- Parameters
-
event The libinput tablet pad event
- Returns
- The event time for this event in microseconds
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
-
event The libinput tablet tool event
- Returns
- 1 if the axis was updated or 0 otherwise
struct libinput_event* libinput_event_tablet_tool_get_base_event | ( | struct libinput_event_tablet_tool * | event | ) |
- Returns
- The generic libinput_event of this event
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
-
event The libinput tablet tool event
- Returns
- the button triggering this event
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
-
event The libinput tablet tool event
- Returns
- the button state triggering this event
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
-
event The libinput tablet tool event
- Returns
- The current value of the the axis
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 Relative motion for tablet tools for more details.
- Parameters
-
event The libinput tablet event
- Returns
- The relative x movement since the last event
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 Relative motion for tablet tools for more details.
- Parameters
-
event The libinput tablet event
- Returns
- The relative y movement since the last event
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
-
event The libinput tablet tool event
- Returns
- The current value of the the axis
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.
See Handling of proximity events for recommendations on proximity handling.
- Parameters
-
event The libinput tablet tool event
- Returns
- The new proximity state of the tool from the event.
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
-
event The libinput tablet tool event
- Returns
- The current value of the the axis
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
-
event The libinput tablet tool event
- Returns
- the seat wide pressed button count for the key of this event
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
-
event The libinput tablet tool event
- Returns
- The current value of the the axis
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
-
event The libinput tablet tool event
- Returns
- The current value of the the axis in degrees
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
-
event The libinput tablet tool event
- Returns
- The current value of the the axis in degrees
uint32_t libinput_event_tablet_tool_get_time | ( | struct libinput_event_tablet_tool * | event | ) |
- Parameters
-
event The libinput tablet tool event
- Returns
- The event time for this event
uint64_t libinput_event_tablet_tool_get_time_usec | ( | struct libinput_event_tablet_tool * | event | ) |
- Parameters
-
event The libinput tablet tool event
- Returns
- The event time for this event in microseconds
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
-
event The libinput tablet tool event
- Returns
- The new tip state of the tool from the event.
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 Tracking unique tools for more details.
- Parameters
-
event The libinput tablet tool event
- Returns
- The new tool triggering this event
double libinput_event_tablet_tool_get_wheel_delta | ( | struct libinput_event_tablet_tool * | event | ) |
Return the delta for the wheel in degrees.
- Parameters
-
event The libinput tablet tool event
- Returns
- The delta of the wheel, in degrees, compared to the last event
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
-
event The libinput tablet tool event
- Returns
- The delta of the wheel, in discrete steps, compared to the last event
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 Out-of-bounds motion events for more details.
- Parameters
-
event The libinput tablet tool event
- Returns
- The current value of the the axis
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 Out-of-bounds motion events for more details.
- Parameters
-
event The libinput tablet tool event width The current output screen width
- Returns
- the current absolute x coordinate transformed to a screen coordinate
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 Out-of-bounds motion events for more details.
- Parameters
-
event The libinput tablet tool event
- Returns
- The current value of the the axis
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 Out-of-bounds motion events for more details.
- Parameters
-
event The libinput tablet tool event height The current output screen height
- Returns
- the current absolute y coordinate transformed to a screen coordinate
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
-
event The libinput tablet tool event
- Returns
- 1 if the axis was updated or 0 otherwise
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
-
event The libinput tablet tool event
- Returns
- 1 if the axis was updated or 0 otherwise
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
-
event The libinput tablet tool event
- Returns
- 1 if the axis was updated or 0 otherwise
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
-
event The libinput tablet tool event
- Returns
- 1 if the axis was updated or 0 otherwise
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
-
event The libinput tablet tool event
- Returns
- 1 if the axis was updated or 0 otherwise
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
-
event The libinput tablet tool event
- Returns
- 1 if the axis was updated or 0 otherwise
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
-
event The libinput tablet tool event
- Returns
- 1 if the axis was updated or 0 otherwise
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
-
event The libinput tablet tool event
- Returns
- 1 if the axis was updated or 0 otherwise
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. See Tracking unique tools for details.
- Parameters
-
tool The libinput tool
- Returns
- The tool serial number
- See also
- libinput_tablet_tool_is_unique
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(), see Vendor-specific tablet tool types. 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.
- Parameters
-
tool The libinput tool
- Returns
- The tool ID for this tool object or 0 if none is provided
- See also
- libinput_tablet_tool_get_type
enum libinput_tablet_tool_type libinput_tablet_tool_get_type | ( | struct libinput_tablet_tool * | tool | ) |
Return the tool type for a tool object, see Vendor-specific tablet tool types for details.
- Parameters
-
tool The libinput tool
- Returns
- The tool type for this tool object
- See also
- libinput_tablet_tool_get_tool_id
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
-
tool The libinput tool
- Returns
- The user data associated with the tool object
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
-
tool A tablet tool code button code to check for
- Returns
- 1 if the tool supports this button code, 0 if it does not
int libinput_tablet_tool_has_distance | ( | struct libinput_tablet_tool * | tool | ) |
Return whether the tablet tool supports distance.
- Parameters
-
tool The tool to check the axis capabilities of
- Returns
- Nonzero if the axis is available, zero otherwise.
int libinput_tablet_tool_has_pressure | ( | struct libinput_tablet_tool * | tool | ) |
Return whether the tablet tool supports pressure.
- Parameters
-
tool The tool to check the axis capabilities of
- Returns
- Nonzero if the axis is available, zero otherwise.
int libinput_tablet_tool_has_rotation | ( | struct libinput_tablet_tool * | tool | ) |
Return whether the tablet tool supports z-rotation.
- Parameters
-
tool The tool to check the axis capabilities of
- Returns
- Nonzero if the axis is available, zero otherwise.
int libinput_tablet_tool_has_slider | ( | struct libinput_tablet_tool * | tool | ) |
Return whether the tablet tool has a slider axis.
- Parameters
-
tool The tool to check the axis capabilities of
- Returns
- Nonzero if the axis is available, zero otherwise.
int libinput_tablet_tool_has_tilt | ( | struct libinput_tablet_tool * | tool | ) |
Return whether the tablet tool supports tilt.
- Parameters
-
tool The tool to check the axis capabilities of
- Returns
- Nonzero if the axis is available, zero otherwise.
int libinput_tablet_tool_has_wheel | ( | struct libinput_tablet_tool * | tool | ) |
Return whether the tablet tool has a relative wheel.
- Parameters
-
tool The tool to check the axis capabilities of
- Returns
- Nonzero if the axis is available, zero otherwise.
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 Tracking unique tools for more details.
- Parameters
-
tool A tablet tool
- Returns
- 1 if the tool can be uniquely identified, 0 otherwise.
- See also
- libinput_tablet_tool_get_serial
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
-
tool The tool to increment the ref count of
- Returns
- The passed tool
- See also
- libinput_tablet_tool_unref
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
-
tool The libinput tool user_data The user data to associate with the tool object
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
-
tool The tool to decrement the ref count of
- Returns
- NULL if the tool was destroyed otherwise the passed tool
- See also
- libinput_tablet_tool_ref