Skip to content

Gdk.DeviceTool

class — extends GObject.Object

A physical tool associated to a GdkDevice.

Methods

get_axes

def get_axes(self) -> AxisFlags

Gets the axes of the tool.

get_hardware_id

def get_hardware_id(self) -> int

Gets the hardware ID of this tool, or 0 if it's not known.

When non-zero, the identifier is unique for the given tool model, meaning that two identical tools will share the same hardware_id, but will have different serial numbers (see DeviceTool.get_serial).

This is a more concrete (and device specific) method to identify a GdkDeviceTool than DeviceTool.get_tool_type, as a tablet may support multiple devices with the same GdkDeviceToolType, but different hardware identifiers.

get_serial

def get_serial(self) -> int

Gets the serial number of this tool.

This value can be used to identify a physical tool (eg. a tablet pen) across program executions.

get_tool_type

def get_tool_type(self) -> DeviceToolType

Gets the GdkDeviceToolType of the tool.

Properties

axes

axes: AxisFlags | int  # read/write

The axes of the tool.

hardware_id

hardware_id: int  # read/write

The hardware ID of the tool.

serial

serial: int  # read/write

The serial number of the tool.

tool_type

tool_type: DeviceToolType | int  # read/write

The type of the tool.