Misc. objects¶
TabletTool¶
-
class
libinput.define.TabletTool(htablettool, libinput)¶ An object representing a tool being used by a device with the
TABLET_TOOLcapability.Tablet events generated by such a device are bound to a specific tool rather than coming from the device directly. Depending on the hardware it is possible to track the same physical tool across multiple
Deviceinstances, see Tracking unique tools.As long as a reference to a
TabletToolis kept, multiple instances will compare equal if they refer to the same physical tool and the hardware supports it.-
type¶ The tool type of a tool object.
See Vendor-specific tablet tool types for details.
Returns: The tool type for this tool object. Return type: TabletToolType
-
tool_id¶ The tool ID of a tool object.
If nonzero, this number identifies the specific type of the tool with more precision than the type returned in
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.
Returns: The tool ID for this tool object or 0 if none is provided. Return type: int
-
has_pressure()¶ Return whether the tablet tool supports pressure.
Returns: Trueif the axis is available,Falseotherwise.Return type: bool
-
has_distance()¶ Return whether the tablet tool supports distance.
Returns: Trueif the axis is available,Falseotherwise.Return type: bool
-
has_tilt()¶ Return whether the tablet tool supports tilt.
Returns: Trueif the axis is available,Falseotherwise.Return type: bool
-
has_rotation()¶ Return whether the tablet tool supports z-rotation.
Returns: Trueif the axis is available,Falseotherwise.Return type: bool
-
has_slider()¶ Return whether the tablet tool has a slider axis.
Returns: Trueif the axis is available,Falseotherwise.Return type: bool
-
has_wheel()¶ Return whether the tablet tool has a relative wheel.
Returns: Trueif the axis is available,Falseotherwise.Return type: bool
Check if a tablet tool has a specified button.
Parameters: button (int) – Button to check for. See input.h.Returns: Trueif the tool supports this button,Falseif it does not.Return type: bool
-
is_unique()¶ Return
Trueif the physical tool can be uniquely identified by libinput, orFalseotherwise.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.
Returns: Trueif the tool can be uniquely identified,Falseotherwise.Return type: bool
-
serial¶ The serial number of a tool.
If the tool does not report a serial number, this method returns zero. See Tracking unique tools for details.
Returns: The tool serial number. Return type: int
-
TabletPadModeGroup¶
-
class
libinput.define.TabletPadModeGroup(hmodegroup, libinput)¶ A mode on a tablet pad is a virtual grouping of functionality, usually based on some visual feedback like LEDs on the pad.
The set of buttons, rings and strips that share the same mode are a “mode group”. Whenever the mode changes, all buttons, rings and strips within this mode group are affected. See Tablet pad modes for detail.
Most tablets only have a single mode group, some tablets provide multiple mode groups through independent banks of LEDs (e.g. the Wacom Cintiq 24HD). libinput guarantees that at least one mode group is always available.
-
index¶ The returned number is the same index as passed to
tablet_pad_get_mode_group().For tablets with only one mode this number is always 0.
Returns: The numeric index this mode group represents, starting at 0. Return type: int
-
num_modes¶ Query the mode group for the number of available modes.
The number of modes is usually decided by the number of physical LEDs available on the device. Different mode groups may have a different number of modes. Use
modeto get the currently active mode.libinput guarantees that at least one mode is available. A device without mode switching capability has a single mode group and a single mode.
Returns: The number of modes available in this mode group. Return type: int
-
mode¶ The current mode this mode group is in.
Returns: The numeric index of the current mode in this group, starting at 0. Return type: int
Devices without mode switching capabilities return
Truefor every button.Parameters: button (int) – A button index, starting at 0. Returns: Trueif the given button index is part of this mode group orFalseotherwise.Return type: bool
-
has_ring(ring)¶ Devices without mode switching capabilities return
Truefor every ring.Parameters: ring (int) – A ring index, starting at 0. Returns: Trueif the given ring index is part of this mode group orFalseotherwise.Return type: bool
-
has_strip(strip)¶ Devices without mode switching capabilities return
Truefor every strip.Parameters: strip (int) – A strip index, starting at 0. Returns: Trueif the given strip index is part of this mode group orFalseotherwise.Return type: bool
The toggle button in a mode group is the button assigned to cycle to or directly assign a new mode when pressed.
Not all devices have a toggle button and some devices may have more than one toggle button. For example, the Wacom Cintiq 24HD has six toggle buttons in two groups, each directly selecting one of the three modes per group.
Devices without mode switching capabilities return
Falsefor every button.Parameters: button (int) – A button index, starting at 0. Returns: Trueif the button is a mode toggle button for this group, orFalseotherwise.Return type: bool
-