:right-sidebar: True GestureSwipe =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: GestureSwipe(**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` ``GtkGestureSwipe`` is a ``GtkGesture`` for swipe gestures. After a press/move/.../move/release sequence happens, the :obj:`~gi.repository.Gtk.GestureSwipe.signals.swipe` signal will be emitted, providing the velocity and directionality of the sequence at the time it was lifted. If the velocity is desired in intermediate points, :obj:`~gi.repository.Gtk.GestureSwipe.get_velocity` can be called in a :obj:`~gi.repository.Gtk.Gesture.signals.update` handler. All velocities are reported in pixels/sec units. Constructors ------------ .. rst-class:: interim-class .. class:: GestureSwipe :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Gesture Returns a newly created ``GtkGesture`` that recognizes swipes. Methods ------- .. rst-class:: interim-class .. class:: GestureSwipe :no-index: .. method:: get_velocity() -> tuple[bool, float, float] Gets the current velocity. If the gesture is recognized, this function returns :const:`True` and fills in ``velocity_x`` and ``velocity_y`` with the recorded velocity, as per the last events processed. Signals ------- .. rst-class:: interim-class .. class:: GestureSwipe.signals :no-index: .. method:: swipe(velocity_x: float, velocity_y: float) -> None Emitted when the recognized gesture is finished. Velocity and direction are a product of previously recorded events. :param velocity_x: velocity in the X axis, in pixels/sec :param velocity_y: velocity in the Y axis, in pixels/sec