Gdk.Event¶
- Subclasses:
Gdk.ButtonEvent
,Gdk.CrossingEvent
,Gdk.DNDEvent
,Gdk.DeleteEvent
,Gdk.FocusEvent
,Gdk.GrabBrokenEvent
,Gdk.KeyEvent
,Gdk.MotionEvent
,Gdk.PadEvent
,Gdk.ProximityEvent
,Gdk.ScrollEvent
,Gdk.TouchEvent
,Gdk.TouchpadEvent
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
None
Fields¶
None
Class Details¶
- class Gdk.Event¶
- Abstract:
Yes
``GdkEvent``s are immutable data structures, created by GDK to represent 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.- get_axes()[source]¶
-
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].
- get_axis(axis_use)[source]¶
- Parameters:
axis_use (
Gdk.AxisUse
) – the axis use to look for- Returns:
True
if the specified axis was found, otherwiseFalse
- value:
location to store the value found
- Return type:
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].
- get_device()[source]¶
- Returns:
a
GdkDevice
- Return type:
Gdk.Device
orNone
Returns the device of an event.
- get_device_tool()[source]¶
- Returns:
The current device tool
- Return type:
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
None
.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()[source]¶
- Returns:
a
GdkDisplay
- Return type:
Gdk.Display
orNone
Retrieves the display associated to the self.
- get_event_sequence()[source]¶
- Returns:
the event sequence that the event belongs to
- Return type:
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_history()[source]¶
- Returns:
an array of time and coordinates
- Return type:
[
Gdk.TimeCoord
] orNone
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.
- get_modifier_state()[source]¶
- Returns:
the modifier state of self
- Return type:
Returns the modifier state field of an event.
- get_pointer_emulated()[source]¶
-
Returns whether this event is an ‘emulated’ pointer event.
Emulated pointer events typically originate from a touch events.
- get_position()[source]¶
- Returns:
- x:
location to put event surface x coordinate
- y:
location to put event surface y coordinate
- Return type:
Extract the event surface relative x/y coordinates from an event.
This position is in surface coordinates.
- get_surface()[source]¶
- Returns:
The
GdkSurface
associated with the event- Return type:
Gdk.Surface
orNone
Extracts the surface associated with an event.
- get_time()[source]¶
- Returns:
timestamp field from self
- Return type:
Returns the timestamp of self.
Not all events have timestamps. In that case, this function returns
Gdk.CURRENT_TIME
.
-
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
.