GtkGestureSwipe: GTK+ 4 Reference Manual

## GtkGestureSwipe GtkGestureSwipe — Swipe gesture |

## Functions

GtkGesture * | gtk_gesture_swipe_new ()
gboolean | gtk_gesture_swipe_get_velocity ()

## Types and Values

| GtkGestureSwipe

## Includes

    #include <gtk/gtk.h>

## Description

GtkGestureSwipe is a GtkGesture implementation able to recognize swipes, after a press/move/.../move/release sequence happens, the “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, `gtk_gesture_swipe_get_velocity()` can be called on eg. a “update” handler.

All velocities are reported in pixels/sec units.

## Functions

### gtk_gesture_swipe_new ()

    GtkGesture *
    gtk_gesture_swipe_new (GtkWidget *widget);

Returns a newly created GtkGesture that recognizes swipes.

#### Parameters

widget | a GtkWidget |

#### Returns

a newly created GtkGestureSwipe

Since: 3.14

### gtk_gesture_swipe_get_velocity ()

    gboolean
    gtk_gesture_swipe_get_velocity (GtkGestureSwipe *gesture,
                                    gdouble *velocity_x,
                                    gdouble *velocity_y);

If the gesture is recognized, this function returns `TRUE` and fill in `velocity_x` and `velocity_y` with the recorded velocity, as per the last event(s) processed.

#### Parameters

gesture | a GtkGestureSwipe |
velocity_x | return value for the velocity in the X axis, in pixels/sec. | [out]
velocity_y | return value for the velocity in the Y axis, in pixels/sec. | [out]

#### Returns

whether velocity could be calculated

Since: 3.14

## Types and Values

### GtkGestureSwipe

    typedef struct _GtkGestureSwipe GtkGestureSwipe;