Gdk.Event
Description: Reference for Gdk.Event

### Class

# GdkEvent

since: 4.0

#### Description [src]

    abstract class Gdk.Event : GObject.TypeInstance
    {
      /* No available fields */
    }

`GdkEvent`s are immutable data structures, created by GDK to represent windowing system events.

In GTK applications the events are handled automatically by toplevel widgets and passed on to the event controllers of appropriate widgets, so using `GdkEvent` and its related API is rarely needed.

Available since: 4.0

#### Descendants

- GdkButtonEvent
- GdkCrossingEvent
- GdkDNDEvent
- GdkDeleteEvent
- GdkFocusEvent
- GdkGrabBrokenEvent
- GdkKeyEvent
- GdkMotionEvent
- GdkPadEvent
- GdkProximityEvent
- GdkScrollEvent
- GdkTouchEvent
- GdkTouchpadEvent

#### Instance methods

###### gdk_events_get_angle

Returns the relative angle from `event1` to `event2`.

since: 4.0

###### gdk_events_get_center

Returns the point halfway between the events’ positions.

since: 4.0

###### gdk_events_get_distance

Returns the distance between the event locations.

since: 4.0

###### gdk_event_get_axes

Extracts all axis values from an event.

since: 4.0

###### gdk_event_get_axis

Extract the axis value for a particular axis use from an event structure.

since: 4.0

###### gdk_event_get_device

Returns the device of an event.

since: 4.0

###### gdk_event_get_device_tool

Returns a `GdkDeviceTool` representing the tool that caused the event.

since: 4.0

###### gdk_event_get_display

Retrieves the display associated to the `event`.

since: 4.0

###### gdk_event_get_event_sequence

Returns the event sequence to which the event belongs.

since: 4.0

###### gdk_event_get_event_type

Retrieves the type of the event.

since: 4.0

###### gdk_event_get_history

Retrieves the history of the device that `event` is for, as a list of time and coordinates.

since: 4.0

###### gdk_event_get_modifier_state

Returns the modifier state field of an event.

since: 4.0

###### gdk_event_get_pointer_emulated

Returns whether this event is an ‘emulated’ pointer event.

since: 4.0

###### gdk_event_get_position

Extract the event surface relative x/y coordinates from an event.

since: 4.0

###### gdk_event_get_seat

Returns the seat that originated the event.

since: 4.0

###### gdk_event_get_surface

Extracts the surface associated with an event.

since: 4.0

###### gdk_event_get_time

Returns the timestamp of `event`.

since: 4.0

###### gdk_event_ref

Increase the ref count of `event`.

since: 4.0

###### gdk_event_triggers_context_menu

Returns whether a `GdkEvent` should trigger a context menu, according to platform conventions.

since: 4.0

###### gdk_event_unref

Decrease the ref count of `event`.

since: 4.0