:right-sidebar: True GestureStylus =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: GestureStylus(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.GestureSingle`, :class:`~gi.repository.Gtk.Gesture`, :class:`~gi.repository.Gtk.EventController`, :class:`~gi.repository.GObject.Object` ``GtkGestureStylus`` is a ``GtkGesture`` specific to stylus input. The provided signals just relay the basic information of the stylus events. Constructors ------------ .. rst-class:: interim-class .. class:: GestureStylus :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Gesture Creates a new ``GtkGestureStylus``\. Methods ------- .. rst-class:: interim-class .. class:: GestureStylus :no-index: .. method:: get_axes(axes: list[~gi.repository.Gdk.AxisUse]) -> ~typing.Tuple[bool, list[float]] Returns the current values for the requested ``axes``\. This function must be called from the handler of one of the :obj:`~gi.repository.Gtk.GestureStylus.signals.down`\, :obj:`~gi.repository.Gtk.GestureStylus.signals.motion`\, :obj:`~gi.repository.Gtk.GestureStylus.signals.up` or :obj:`~gi.repository.Gtk.GestureStylus.signals.proximity` signals. :param axes: array of requested axes, terminated with %GDK_AXIS_IGNORE .. method:: get_axis(axis: ~gi.repository.Gdk.AxisUse) -> ~typing.Tuple[bool, float] Returns the current value for the requested ``axis``\. This function must be called from the handler of one of the :obj:`~gi.repository.Gtk.GestureStylus.signals.down`\, :obj:`~gi.repository.Gtk.GestureStylus.signals.motion`\, :obj:`~gi.repository.Gtk.GestureStylus.signals.up` or :obj:`~gi.repository.Gtk.GestureStylus.signals.proximity` signals. :param axis: requested device axis .. method:: get_backlog() -> ~typing.Tuple[bool, list[~gi.repository.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 :obj:`~gi.repository.Gtk.GestureStylus.signals.motion` signal handler, the state given in this signal and obtainable through :obj:`~gi.repository.Gtk.GestureStylus.get_axis` express the latest (most up-to-date) state in motion history. The ``backlog`` is provided in chronological order. .. method:: get_device_tool() -> ~gi.repository.Gdk.DeviceTool | None Returns the ``GdkDeviceTool`` currently driving input through this gesture. This function must be called from the handler of one of the :obj:`~gi.repository.Gtk.GestureStylus.signals.down`\, :obj:`~gi.repository.Gtk.GestureStylus.signals.motion`\, :obj:`~gi.repository.Gtk.GestureStylus.signals.up` or :obj:`~gi.repository.Gtk.GestureStylus.signals.proximity` signals. .. method:: get_stylus_only() -> bool Checks whether the gesture is for styluses only. Stylus-only gestures will signal events exclusively from stylus input devices. .. versionadded:: 4.10 .. method:: 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. .. versionadded:: 4.10 :param stylus_only: whether the gesture is used exclusively for stylus events Properties ---------- .. rst-class:: interim-class .. class:: GestureStylus :no-index: .. attribute:: props.stylus_only :type: bool The type of the None singleton. .. versionadded:: 4.10 Signals ------- .. rst-class:: interim-class .. class:: GestureStylus.signals :no-index: .. method:: down(x: float, y: float) -> None The type of the None singleton. :param x: the X coordinate of the stylus event :param y: the Y coordinate of the stylus event .. method:: motion(x: float, y: float) -> None The type of the None singleton. :param x: the X coordinate of the stylus event :param y: the Y coordinate of the stylus event .. method:: proximity(x: float, y: float) -> None The type of the None singleton. :param x: the X coordinate of the stylus event :param y: the Y coordinate of the stylus event .. method:: up(x: float, y: float) -> None The type of the None singleton. :param x: the X coordinate of the stylus event :param y: the Y coordinate of the stylus event