Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Event

[16:7] extends: object

Represents 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. GdkEvent structs are immutable.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Event (Handle = null)

    Creates a new Event by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • get_device ()

    Returns the device of an event.

  • get_device_tool ()

    Returns a GdkDeviceTool representing the tool that caused the event. If the was not generated by a device that supports different tools (such as a tablet), this function will return %NULL. Note: the GdkDeviceTool will be constant during the application lifetime, if settings must be stored persistently across runs, see [method@Gdk.DeviceTool.get_serial].

  • get_display ()

    Retrieves the display associated to the @event.

  • get_event_sequence ()

    Returns the event sequence to which the event belongs. Related touch events are connected in a sequence. Other events typically don't have event sequence information.

  • get_event_type ()

    Retrieves the type of the event.

  • get_modifier_state ()

    Returns the modifier state field of an event.

  • get_pointer_emulated ()

    Returns whether this event is an 'emulated' pointer event. Emulated pointer events typically originate from a touch events.

  • get_seat ()

    Returns the seat that originated the event.

  • get_surface ()

    Extracts the surface associated with an event.

  • ref ()

    Increase the ref count of @event.

  • triggers_context_menu ()

    Returns whether a GdkEvent should trigger a context menu, according to platform conventions. The right mouse button typically triggers context menus. On macOS, Control+left mouse button also triggers. This function should always be used instead of simply checking for c event->button == GDK_BUTTON_SECONDARY

  • unref ()

    Decrease the ref count of @event. If the last reference is dropped, the structure is freed.

    • @r None.