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.
Returns the relative angle from self 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 #f.
Passed: a <GdkEvent>.
first <GdkEvent>
Passed: a <GdkEvent>.
second <GdkEvent>
Returned: a boolean.
#t if the angle could be calculated.
Returned: a real number.
return location for the relative angle between both events
Returns the point halfway between the events’ positions.
This assumes that both events have X/Y information. If not, this
function returns #f.
Passed: a <GdkEvent>.
first <GdkEvent>
Passed: a <GdkEvent>.
second <GdkEvent>
Returned: a boolean.
#t if the center could be calculated.
Returned: a real number.
return location for the X coordinate of the center
Returned: a real number.
return location for the Y coordinate of the center
Returns the distance between the event locations.
This assumes that both events have X/Y information. If not, this
function returns #f.
Passed: a <GdkEvent>.
first <GdkEvent>
Passed: a <GdkEvent>.
second <GdkEvent>
Returned: a boolean.
#t if the distance could be calculated.
Returned: a real number.
return location for the distance
Extracts all axis values from an event.
To find out which axes are used, use device-tool:get-axes on the device tool returned by
event:get-device-tool.
Passed: a <GdkEvent>.
Returned: a boolean.
#t on success, otherwise #f
Returned: a f64vector.
the array of values for all axes
Not returned: it is the length of axes.
the length of array
Extract the axis value for a particular axis use from an event structure.
To find out which axes are used, use device-tool:get-axes on the device tool returned by
event:get-device-tool.
Passed: a <GdkEvent>.
Passed: a <GdkAxisUse>, or one of its symbols.
the axis use to look for
Returned: a boolean.
#t if the specified axis was found, otherwise #f
Returned: a real number.
location to store the value found
Returns the device of an event.
Passed: a <GdkEvent>.
a <GdkEvent>.
Returned: a <GdkDevice>, or #f.
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 #f.
Note: the <GdkDeviceTool> will be constant
during the application lifetime, if settings must be stored persistently
across runs, see device-tool:get-serial.
Passed: a <GdkEvent>.
Returned: a <GdkDeviceTool>, or #f.
The current device tool
Retrieves the display associated to the self.
Passed: a <GdkEvent>.
Returned: a <GdkDisplay>, or #f.
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.
Passed: a <GdkEvent>.
Returned: a <GdkEventSequence>.
the event sequence that the event belongs to
Retrieves the type of the event.
Passed: a <GdkEvent>.
Returned: a <GdkEventType>.
a <GdkEvent>Type
Retrieves the history of the device that self 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 self.
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.
Passed: a <GdkEvent>.
a motion or scroll event
Returned: a vector, each a <GdkTimeCoord>, or
#f.
an array of time and coordinates
Not returned: it is the length of %return.
Return location for the length of the returned array
Returns the modifier state field of an event.
Passed: a <GdkEvent>.
Returned: a <GdkModifierType>.
the modifier state of self
Returns whether this event is an ’emulated’ pointer event.
Emulated pointer events typically originate from a touch events.
Passed: a <GdkEvent>.
Returned: a boolean.
#t if this event is emulated
Extract the event surface relative x/y coordinates from an event.
This position is in surface coordinates.
Passed: a <GdkEvent>.
Returned: a boolean.
whether the positions were set
Returned: a real number.
location to put event surface x coordinate
Returned: a real number.
location to put event surface y coordinate
Returns the seat that originated the event.
Passed: a <GdkEvent>.
Returned: a <GdkSeat>, or #f.
a <GdkSeat>.
Extracts the surface associated with an event.
Passed: a <GdkEvent>.
Returned: a <GdkSurface>, or #f.
The <GdkSurface> associated with the event
Returns the timestamp of self.
Not all events have timestamps. In that case, this function returns
GDK_CURRENT_TIME.
Passed: a <GdkEvent>.
Returned: an unsigned 32-bit integer.
timestamp field from self
Increase the ref count of self.
Passed: a <GdkEvent>.
Returned: a <GdkEvent>.
self
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
event->button == GDK_BUTTON_SECONDARY
Passed: a <GdkEvent>.
a <GdkEvent>, currently only button events are
meaningful values
Returned: a boolean.
#t if the event should trigger a context menu.
Decrease the ref count of self.
If the last reference is dropped, the structure is freed.
Passed: a <GdkEvent>.