Gtk.GestureStylus

g GObject.Object GObject.Object Gtk.EventController Gtk.EventController GObject.Object->Gtk.EventController Gtk.Gesture Gtk.Gesture Gtk.EventController->Gtk.Gesture Gtk.GestureSingle Gtk.GestureSingle Gtk.Gesture->Gtk.GestureSingle Gtk.GestureStylus Gtk.GestureStylus Gtk.GestureSingle->Gtk.GestureStylus

Subclasses:

None

Methods

Inherited:

Gtk.GestureSingle (8), Gtk.Gesture (17), Gtk.EventController (13), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_axes (axes)

get_axis (axis)

get_backlog ()

get_device_tool ()

get_stylus_only ()

set_stylus_only (stylus_only)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Gtk.GestureSingle (3), Gtk.Gesture (1), Gtk.EventController (4)

Name

Type

Flags

Short Description

stylus-only

bool

r/w/c/en

Signals

Inherited:

Gtk.Gesture (5), GObject.Object (1)

Name

Short Description

down

Emitted when the stylus touches the device.

motion

Emitted when the stylus moves while touching the device.

proximity

Emitted when the stylus is in proximity of the device.

up

Emitted when the stylus no longer touches the device.

Fields

Inherited:

Gtk.Gesture (5), GObject.Object (1)

Class Details

class Gtk.GestureStylus(**kwargs)
Bases:

Gtk.GestureSingle

Abstract:

No

Structure:

Gtk.GestureStylusClass

GtkGestureStylus is a GtkGesture specific to stylus input.

The provided signals just relay the basic information of the stylus events.

classmethod new()[source]
Returns:

a newly created stylus gesture

Return type:

Gtk.Gesture

Creates a new GtkGestureStylus.

get_axes(axes)[source]
Parameters:

axes ([Gdk.AxisUse]) – array of requested axes, terminated with Gdk.AxisUse.IGNORE

Returns:

True if there is a current value for the axes

values:

return location for the axis values

Return type:

(bool, values: [float])

Returns the current values for the requested axes.

This function must be called from the handler of one of the [signal`Gtk`.GestureStylus::down], [signal`Gtk`.GestureStylus::motion], [signal`Gtk`.GestureStylus::up] or [signal`Gtk`.GestureStylus::proximity] signals.

get_axis(axis)[source]
Parameters:

axis (Gdk.AxisUse) – requested device axis

Returns:

True if there is a current value for the axis

value:

return location for the axis value

Return type:

(bool, value: float)

Returns the current value for the requested axis.

This function must be called from the handler of one of the [signal`Gtk`.GestureStylus::down], [signal`Gtk`.GestureStylus::motion], [signal`Gtk`.GestureStylus::up] or [signal`Gtk`.GestureStylus::proximity] signals.

get_backlog()[source]
Returns:

True if there is a backlog to unfold in the current state.

backlog:

coordinates and times for the backlog events

Return type:

(bool, backlog: [Gdk.TimeCoord])

Returns the accumulated backlog of tracking information.

By default, GTK will limit rate of input events. On stylus input where accuracy of strokes is paramount, this function returns the accumulated coordinate/timing state before the emission of the current [Gtk.GestureStylus::motion] signal.

This function may only be called within a [signal`Gtk`.GestureStylus::motion] signal handler, the state given in this signal and obtainable through [method`Gtk`.GestureStylus.get_axis] express the latest (most up-to-date) state in motion history.

The backlog is provided in chronological order.

get_device_tool()[source]
Returns:

The current stylus tool

Return type:

Gdk.DeviceTool or None

Returns the GdkDeviceTool currently driving input through this gesture.

This function must be called from the handler of one of the [signal`Gtk`.GestureStylus::down], [signal`Gtk`.GestureStylus::motion], [signal`Gtk`.GestureStylus::up] or [signal`Gtk`.GestureStylus::proximity] signals.

get_stylus_only()[source]
Returns:

True if the gesture is only for stylus events

Return type:

bool

Checks whether the gesture is for styluses only.

Stylus-only gestures will signal events exclusively from stylus input devices.

New in version 4.10.

set_stylus_only(stylus_only)[source]
Parameters:

stylus_only (bool) – whether the gesture is used exclusivly for stylus events

Sets the state of stylus-only

If true, the gesture will exclusivly handle events from stylus input deivces, otherwise it’ll handle events from any pointing device.

New in version 4.10.

Signal Details

Gtk.GestureStylus.signals.down(gesture_stylus, x, y)
Signal Name:

down

Flags:

RUN_LAST

Parameters:
  • gesture_stylus (Gtk.GestureStylus) – The object which received the signal

  • x (float) – the X coordinate of the stylus event

  • y (float) – the Y coordinate of the stylus event

Emitted when the stylus touches the device.

Gtk.GestureStylus.signals.motion(gesture_stylus, x, y)
Signal Name:

motion

Flags:

RUN_LAST

Parameters:
  • gesture_stylus (Gtk.GestureStylus) – The object which received the signal

  • x (float) – the X coordinate of the stylus event

  • y (float) – the Y coordinate of the stylus event

Emitted when the stylus moves while touching the device.

Gtk.GestureStylus.signals.proximity(gesture_stylus, x, y)
Signal Name:

proximity

Flags:

RUN_LAST

Parameters:
  • gesture_stylus (Gtk.GestureStylus) – The object which received the signal

  • x (float) – the X coordinate of the stylus event

  • y (float) – the Y coordinate of the stylus event

Emitted when the stylus is in proximity of the device.

Gtk.GestureStylus.signals.up(gesture_stylus, x, y)
Signal Name:

up

Flags:

RUN_LAST

Parameters:
  • gesture_stylus (Gtk.GestureStylus) – The object which received the signal

  • x (float) – the X coordinate of the stylus event

  • y (float) – the Y coordinate of the stylus event

Emitted when the stylus no longer touches the device.

Property Details

Gtk.GestureStylus.props.stylus_only
Name:

stylus-only

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

If this gesture should exclusively react to stylus input devices.

New in version 4.10.