Class (GI Class)

Gdk-4.0GdkTouchEvent

An event related to a touch-based device.

Hierarchy (View Summary)

Index

Constructors

Properties

Methods

  • Extracts whether a touch event is emulating a pointer event.

    Returns boolean

    true if event is emulating

Methods - Inherited from Gdk.Event

  • Returns the relative angle from event1 to event2.

    The relative angle is the angle between the X axis and the line through both events' positions. The rotation direction for positive angles is from the positive X axis towards the positive Y axis.

    This assumes that both events have X/Y information. If not, this function returns false.

    Parameters

    Returns [boolean, number]

    true if the angle could be calculated.

  • Returns the point halfway between the events' positions.

    This assumes that both events have X/Y information. If not, this function returns false.

    Parameters

    Returns [boolean, number, number]

    true if the center could be calculated.

  • Returns the distance between the event locations.

    This assumes that both events have X/Y information. If not, this function returns false.

    Parameters

    Returns [boolean, number]

    true if the distance could be calculated.

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

    The history includes positions that are not delivered as separate events to the application because they occurred in the same frame as event.

    Note that only motion and scroll events record history, and motion events do it only if one of the mouse buttons is down, or the device has a tool.

    Returns Gdk.TimeCoord[]

    an array of time and coordinates

  • Returns whether this event is an 'emulated' pointer event.

    Emulated pointer events typically originate from a touch events.

    Returns boolean

    true if this event is emulated

  • Returns the timestamp of event.

    Not all events have timestamps. In that case, this function returns GDK_CURRENT_TIME.

    Returns number

    timestamp field from event

  • Returns whether a Gdk.Event 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

    event->button == GDK_BUTTON_SECONDARY
    

    Returns boolean

    true if the event should trigger a context menu.

Interfaces

SignalSignatures