Gdk.DeviceTool

g GObject.Object GObject.Object Gdk.DeviceTool Gdk.DeviceTool GObject.Object->Gdk.DeviceTool

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_hardware_id ()

get_serial ()

get_tool_type ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

axes

Gdk.AxisFlags

r/w/co

Tool axes

hardware-id

int

r/w/co

Hardware ID

serial

int

r/w/co

Serial number

tool-type

Gdk.DeviceToolType

r/w/co

Tool type

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gdk.DeviceTool(**kwargs)
Bases:

GObject.Object

Abstract:

No

get_hardware_id()[source]
Returns:

The hardware identificator of this tool.

Return type:

int

Gets the hardware ID of this tool, or 0 if it’s not known. When non-zero, the identificator 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 Gdk.DeviceTool.get_serial()).

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

New in version 3.22.

get_serial()[source]
Returns:

The serial ID for this tool

Return type:

int

Gets the serial of this tool, this value can be used to identify a physical tool (eg. a tablet pen) across program executions.

New in version 3.22.

get_tool_type()[source]
Returns:

The physical type for this tool. This can be used to figure out what sort of pen is being used, such as an airbrush or a pencil.

Return type:

Gdk.DeviceToolType

Gets the Gdk.DeviceToolType of the tool.

New in version 3.22.

Property Details

Gdk.DeviceTool.props.axes
Name:

axes

Type:

Gdk.AxisFlags

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Tool axes

Gdk.DeviceTool.props.hardware_id
Name:

hardware-id

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Hardware ID

Gdk.DeviceTool.props.serial
Name:

serial

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Serial number

Gdk.DeviceTool.props.tool_type
Name:

tool-type

Type:

Gdk.DeviceToolType

Default Value:

Gdk.DeviceToolType.UNKNOWN

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Tool type