## GtkEventControllerMotion GtkEventControllerMotion — Event controller for motion events |

## Functions

GtkEventController * | gtk_event_controller_motion_new ()
gboolean | gtk_event_controller_motion_contains_pointer ()
gboolean | gtk_event_controller_motion_is_pointer ()

## Properties

gboolean | contains-pointer | Read
gboolean | is-pointer | Read

## Signals

void | enter | Run Last
void | leave | Run Last
void | motion | Run First

## Types and Values

| GtkEventControllerMotion

## Object Hierarchy

        GObject
        ╰── GtkEventController
            ╰── GtkEventControllerMotion

## Includes

    #include <gtk/gtk.h>

## Description

GtkEventControllerMotion is an event controller meant for situations where you need to track the position of the pointer.

## Functions

### gtk_event_controller_motion_new ()

    GtkEventController *
    gtk_event_controller_motion_new (void);

Creates a new event controller that will handle motion events.

#### Returns

a new GtkEventControllerMotion

### gtk_event_controller_motion_contains_pointer ()

    gboolean
    gtk_event_controller_motion_contains_pointer
                                   (GtkEventControllerMotion *self);

Returns the value of the GtkEventControllerMotion:contains-pointer property.

#### Parameters

self | a GtkEventControllerMotion |

#### Returns

`TRUE` if a pointer is within `self` or one of its children

### gtk_event_controller_motion_is_pointer ()

    gboolean
    gtk_event_controller_motion_is_pointer
                                   (GtkEventControllerMotion *self);

Returns the value of the GtkEventControllerMotion:is-pointer property.

#### Parameters

self | a GtkEventControllerMotion |

#### Returns

`TRUE` if a pointer is within `self` but not one of its children

## Types and Values

### GtkEventControllerMotion

    typedef struct _GtkEventControllerMotion GtkEventControllerMotion;

## Property Details

### The `“contains-pointer”` property

      “contains-pointer”         gboolean

Whether the pointer is in the controllers widget or a descendant. See also “is-pointer”.

When handling crossing events, this property is updated before “enter” but after “leave” is emitted.

Owner: GtkEventControllerMotion

Flags: Read

Default value: FALSE

### The `“is-pointer”` property

      “is-pointer”               gboolean

Whether the pointer is in the controllers widget itself, as opposed to in a descendent widget. See also “contains-pointer”.

When handling crossing events, this property is updated before “enter” but after “leave” is emitted.

Owner: GtkEventControllerMotion

Flags: Read

Default value: FALSE

## Signal Details

### The `“enter”` signal

    void
    user_function (GtkEventControllerMotion *controller,
                   gdouble                   x,
                   gdouble                   y,
                   GdkCrossingMode           mode,
                   gpointer                  user_data)

Signals that the pointer has entered the widget.

#### Parameters

controller | the object which received the signal |
x | coordinates of pointer location |
y | coordinates of pointer location |
mode | crossing mode |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“leave”` signal

    void
    user_function (GtkEventControllerMotion *controller,
                   GdkCrossingMode           mode,
                   gpointer                  user_data)

Signals that the pointer has left the widget.

#### Parameters

controller | the object which received the signal |
mode | crossing mode |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“motion”` signal

    void
    user_function (GtkEventControllerMotion *controller,
                   gdouble                   x,
                   gdouble                   y,
                   gpointer                  user_data)

Emitted when the pointer moves inside the widget.

#### Parameters

controller | The object that received the signal |
x | the x coordinate |
y | the y coordinate |
user_data | user data set when the signal handler was connected. |

Flags: Run First

## See Also

GtkEventController