### Method

# WebKit2 ContextMenu get_event

since: 2.40

#### Declaration [src]

    GdkEvent*
    webkit_context_menu_get_event (
      WebKitContextMenu* menu
    )

#### Description [src]

Gets the `GdkEvent` that triggered the context menu. This function only returns a valid `GdkEvent` when called for a `WebKitContextMenu` passed to `WebKitWebView::context-menu` signal; in all other cases, `NULL` is returned.

The returned `GdkEvent` is expected to be one of the following types: <itemizedlist> <listitem><para> a `GdkEventButton` of type `GDK_BUTTON_PRESS` when the context menu was triggered with mouse. </para></listitem> <listitem><para> a `GdkEventKey` of type `GDK_KEY_PRESS` if the keyboard was used to show the menu. </para></listitem> <listitem><para> a generic `GdkEvent` of type `GDK_NOTHING` when the `GtkWidget::popup-menu` signal was used to show the context menu. </para></listitem> </itemizedlist>

Available since: 2.40

#### Return value

Type: `GdkEvent`

The menu event or `NULL`.

The data is owned by the instance.