GestureStylus#
Superclasses: GestureSingle
, Gesture
, EventController
, Object
GtkGestureStylus
is a GtkGesture
specific to stylus input.
The provided signals just relay the basic information of the stylus events.
Constructors#
Methods#
- class GestureStylus
- get_axes(axes: list[AxisUse]) Tuple[bool, list[float]] #
Returns the current values for the requested
axes
.This function must be called from the handler of one of the
down
,motion
,up
orproximity
signals.- Parameters:
axes – array of requested axes, terminated with %GDK_AXIS_IGNORE
- get_axis(axis: AxisUse) Tuple[bool, float] #
Returns the current value for the requested
axis
.This function must be called from the handler of one of the
down
,motion
,up
orproximity
signals.- Parameters:
axis – requested device axis
- get_backlog() Tuple[bool, list[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
motion
signal handler, the state given in this signal and obtainable throughget_axis
express the latest (most up-to-date) state in motion history.The
backlog
is provided in chronological order.
- get_device_tool() DeviceTool | None #
Returns the
GdkDeviceTool
currently driving input through this gesture.This function must be called from the handler of one of the
down
,motion
,up
orproximity
signals.
- get_stylus_only() bool #
Checks whether the gesture is for styluses only.
Stylus-only gestures will signal events exclusively from stylus input devices.
Added in version 4.10.
- set_stylus_only(stylus_only: bool) None #
Sets the state of stylus-only
If true, the gesture will exclusively handle events from stylus input devices, otherwise it’ll handle events from any pointing device.
Added in version 4.10.
- Parameters:
stylus_only – whether the gesture is used exclusively for stylus events
Properties#
Signals#
- class GestureStylus.signals
- down(x: float, y: float) None #
The type of the None singleton.
- Parameters:
x – the X coordinate of the stylus event
y – the Y coordinate of the stylus event
- motion(x: float, y: float) None #
The type of the None singleton.
- Parameters:
x – the X coordinate of the stylus event
y – the Y coordinate of the stylus event