package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Event

type t = [ `event ] Gobject.obj
val unref : t -> unit

Decrease the ref count of @event.

If the last reference is dropped, the structure is freed.

val triggers_context_menu : t -> bool

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

The right mouse button typically triggers context menus.

This function should always be used instead of simply checking for event->button == %GDK_BUTTON_SECONDARY.

val ref : t -> t

Increase the ref count of @event.

val get_time : t -> UInt32.t

Returns the timestamp of @event.

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

val get_surface : t -> [ `surface | `object_ ] Gobject.obj option

Extracts the surface associated with an event.

val get_seat : t -> [ `seat | `object_ ] Gobject.obj option

Returns the seat that originated the event.

val get_position : t -> bool * float * float

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

This position is in surface coordinates(coordinates.html).

val get_pointer_emulated : t -> bool

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

Emulated pointer events typically originate from a touch events.

val get_modifier_state : t -> Gdk_enums.modifiertype

Returns the modifier state field of an event.

val get_history : t -> [ `time_coord ] Gobject.obj array option * int

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.

val get_event_type : t -> Gdk_enums.eventtype

Retrieves the type of the event.

val get_event_sequence : t -> [ `event_sequence ] Gobject.obj

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.

val get_display : t -> [ `display | `object_ ] Gobject.obj option

Retrieves the display associated to the @event.

val get_device_tool : t -> [ `device_tool | `object_ ] Gobject.obj option

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.

val get_device : t -> [ `device | `object_ ] Gobject.obj option

Returns the device of an event.

val get_axis : t -> Gdk_enums.axisuse -> bool * float

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

To find out which axes are used, use method@Gdk.DeviceTool.get_axes on the device tool returned by method@Gdk.Event.get_device_tool.

val get_axes : t -> bool * float array * int

Extracts all axis values from an event.

To find out which axes are used, use method@Gdk.DeviceTool.get_axes on the device tool returned by method@Gdk.Event.get_device_tool.

val _get_distance : t -> t -> bool * float

Returns the distance between the event locations.

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

val _get_center : t -> t -> bool * float * float

Returns the point halfway between the events' positions.

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

val _get_angle : t -> t -> bool * float

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.