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 
 - 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 - GdkEventand its related API is rarely needed.- GdkEventstructs are immutable.- 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:
- Trueif the specified axis was found, otherwise- False- 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.Deviceor- None
 - Returns the device of an event. 
 - get_device_tool()[source]¶
- Returns:
- The current device tool 
- Return type:
 - Returns a - GdkDeviceToolrepresenting 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 - GdkDeviceToolwill 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.Displayor- None
 - 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] or- None
 - 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:
- whether the positions were set - 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 - GdkSurfaceassociated with the event
- Return type:
- Gdk.Surfaceor- None
 - 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 GdkEventshould 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 ``