Creates a new event of the given type. All fields are set to 0.
Copies a #GdkEvent, copying or incrementing the reference count of the resources associated with it (e.g. #GdkWindow’s and strings).
Extract the axis value for a particular axis use from an event structure.
Extract the button number from an event.
Extracts the click count from an event.
Extract the event window relative x/y coordinates from an event.
If the event contains a “device” field, this function will return it, else it will return null.
If the event was generated by a device that supports different tools (eg. a tablet), this function will return a #GdkDeviceTool representing the tool that caused the event. Otherwise, null will be returned.
If event if of type gdk.types.EventType.TouchBegin, gdk.types.EventType.TouchUpdate, gdk.types.EventType.TouchEnd or gdk.types.EventType.TouchCancel, returns the #GdkEventSequence to which the event belongs. Otherwise, return null.
Retrieves the type of the event.
Extracts the hardware keycode from an event.
Extracts the keyval from an event.
#event: a #GdkEvent Returns whether this event is an 'emulated' pointer event (typically from a touch event), as opposed to a real one.
Extract the root window relative x/y coordinates from an event.
Gets the keyboard low-level scancode of a key event.
Returns the screen for the event. The screen is typically the screen for event->any.window, but for events such as mouse events, it is the screen where the pointer was when the event occurs - that is, the screen which has the root window to which event->motion.x_root and event->motion.y_root are relative.
Retrieves the scroll deltas from a #GdkEvent
Extracts the scroll direction from an event.
Returns the #GdkSeat this event was generated for.
This function returns the hardware (slave) #GdkDevice that has triggered the event, falling back to the virtual (master) device (as in gdk.event.Event.getDevice) if the event wasn’t caused by interaction with a hardware device. This may happen for example in synthesized crossing events after a #GdkWindow updates its geometry or a grab is acquired/released.
If the event contains a “state” field, puts that field in state. Otherwise stores an empty state (0). Returns true if there was a state field in the event. event may be null, in which case it’s treated as if the event had no state field.
Returns the time stamp from event, if there is one; otherwise returns #GDK_CURRENT_TIME. If event is null, returns #GDK_CURRENT_TIME.
Extracts the #GdkWindow associated with an event.
Check whether a scroll event is a stop scroll event. Scroll sequences with smooth scroll information may provide a stop scroll event once the interaction with the device finishes, e.g. by lifting a finger. This stop scroll event is the signal that a widget may trigger kinetic scrolling based on the current velocity.
Appends a copy of the given event onto the front of the event queue for event->any.window’s display, or the default event queue if event->any.window is null. See gdk.display.Display.putEvent.
Returns this, for use in with statements.
Sets the device for event to device. The event must have been allocated by GTK+, for instance, by gdk.event.Event.copy.
Sets the device tool for this event, should be rarely used.
Sets the screen for event to screen. The event must have been allocated by GTK+, for instance, by gdk.event.Event.copy.
Sets the slave device for event to device.
This function returns whether a #GdkEventButton should trigger a context menu, according to platform conventions. The right mouse button always triggers context menus. Additionally, if gdk.keymap.Keymap.getModifierMask returns a non-0 mask for gdk.types.ModifierIntent.ContextMenu, then the left mouse button will also trigger a context menu if this modifier is pressed.
Get any field.
Get button field.
Get configure field.
Get crossing field.
Get dnd field.
Get expose field.
Get focusChange field.
Get grabBroken field.
Get key field.
Get motion field.
Get ownerChange field.
Get padAxis field.
Get padButton field.
Get padGroupMode field.
Get property field.
Get proximity field.
Get scroll field.
Get selection field.
Get setting field.
Get touch field.
Get touchpadPinch field.
Get touchpadSwipe field.
Get type field.
Set type field.
Get visibility field.
Get windowState field.
Checks all open displays for a #GdkEvent to process,to be processed on, fetching events from the windowing system if necessary. See gdk.display.Display.getEvent.
Sets the function to call to handle all events from GDK.
If there is an event waiting in the event queue of some open display, returns a copy of it. See gdk.display.Display.peekEvent.
Request more motion notifies if event is a motion notify hint event.
Pointer to the C boxed value
Get the GType of this boxed type.
Boxed GType property.
Convenience method to return this cast to a type. For use in D with statements.
Make a copy of the wrapped C boxed data.
Copy a C boxed value using g_boxed_copy.
Free a C boxed value using g_boxed_free.
A #GdkEvent contains a union of all of the event types, and allows access to the data fields in a number of ways.
The event type is always the first field in all of the event types, and can always be accessed with the following code, no matter what type of event it is:
To access other fields of the event, the pointer to the event can be cast to the appropriate event type, or the union member name can be used. For example if the event type is gdk.types.EventType.ButtonPress then the x coordinate of the button press can be accessed with:
or: