gdk.event

Module for [Event] class

class Event

Types 1

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:

GdkEvent *event;
 GdkEventType type;

 type = event->type;

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:

GdkEvent *event;
 gdouble x;

 x = ((GdkEventButton*)event)->x;
or:
GdkEvent *event;
 gdouble x;

 x = event->button.x;

Methods
void * _cPtr(Flag!"Dup" dup = No.Dup)
GType _gType() @property
Event self()Returns `this`, for use in `with` statements.
gdk.types.EventType type() @propertyGet `type` field. Returns: the #GdkEventType
void type(gdk.types.EventType propval) @propertySet `type` field. Params: propval = the #GdkEventType
gdk.event_any.EventAny any() @propertyGet `any` field. Returns: a #GdkEventAny
gdk.event_expose.EventExpose expose() @propertyGet `expose` field. Returns: a #GdkEventExpose
gdk.event_visibility.EventVisibility visibility() @propertyGet `visibility` field. Returns: a #GdkEventVisibility
gdk.event_motion.EventMotion motion() @propertyGet `motion` field. Returns: a #GdkEventMotion
gdk.event_button.EventButton button() @propertyGet `button` field. Returns: a #GdkEventButton
gdk.event_touch.EventTouch touch() @propertyGet `touch` field. Returns: a #GdkEventTouch
gdk.event_scroll.EventScroll scroll() @propertyGet `scroll` field. Returns: a #GdkEventScroll
gdk.event_key.EventKey key() @propertyGet `key` field. Returns: a #GdkEventKey
gdk.event_crossing.EventCrossing crossing() @propertyGet `crossing` field. Returns: a #GdkEventCrossing
gdk.event_focus.EventFocus focusChange() @propertyGet `focusChange` field. Returns: a #GdkEventFocus
gdk.event_configure.EventConfigure configure() @propertyGet `configure` field. Returns: a #GdkEventConfigure
gdk.event_property.EventProperty property() @propertyGet `property` field. Returns: a #GdkEventProperty
gdk.event_selection.EventSelection selection() @propertyGet `selection` field. Returns: a #GdkEventSelection
gdk.event_owner_change.EventOwnerChange ownerChange() @propertyGet `ownerChange` field. Returns: a #GdkEventOwnerChange
gdk.event_proximity.EventProximity proximity() @propertyGet `proximity` field. Returns: a #GdkEventProximity
gdk.event_dnd.EventDND dnd() @propertyGet `dnd` field. Returns: a #GdkEventDND
gdk.event_window_state.EventWindowState windowState() @propertyGet `windowState` field. Returns: a #GdkEventWindowState
gdk.event_setting.EventSetting setting() @propertyGet `setting` field. Returns: a #GdkEventSetting
gdk.event_grab_broken.EventGrabBroken grabBroken() @propertyGet `grabBroken` field. Returns: a #GdkEventGrabBroken
gdk.event_touchpad_swipe.EventTouchpadSwipe touchpadSwipe() @propertyGet `touchpadSwipe` field. Returns: a #GdkEventTouchpadSwipe
gdk.event_touchpad_pinch.EventTouchpadPinch touchpadPinch() @propertyGet `touchpadPinch` field. Returns: a #GdkEventTouchpadPinch
gdk.event_pad_button.EventPadButton padButton() @propertyGet `padButton` field. Returns: a #GdkEventPadButton
gdk.event_pad_axis.EventPadAxis padAxis() @propertyGet `padAxis` field. Returns: a #GdkEventPadAxis
gdk.event_pad_group_mode.EventPadGroupMode padGroupMode() @propertyGet `padGroupMode` field. Returns: a #GdkEventPadGroupMode
gdk.event.Event copy()Copies a #GdkEvent, copying or incrementing the reference count of the resources associated with it (e.g. #GdkWindow’s and strings). Returns: a copy of event. The returned #GdkEvent should be fre...
bool getAxis(gdk.types.AxisUse axisUse, out double value)Extract the axis value for a particular axis use from an event structure.
bool getButton(out uint button)Extract the button number from an event.
bool getClickCount(out uint clickCount)Extracts the click count from an event.
bool getCoords(out double xWin, out double yWin)Extract the event window relative x/y coordinates from an event.
gdk.device.Device getDevice()If the event contains a “device” field, this function will return it, else it will return null. Returns: a #GdkDevice, or null.
gdk.device_tool.DeviceTool getDeviceTool()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 ...
gdk.event_sequence.EventSequence getEventSequence()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 ...
gdk.types.EventType getEventType()Retrieves the type of the event. Returns: a #GdkEventType
bool getKeycode(out ushort keycode)Extracts the hardware keycode from an event.
bool getKeyval(out uint keyval)Extracts the keyval from an event.
bool getPointerEmulated()#event: a #GdkEvent Returns whether this event is an 'emulated' pointer event (typically from a touch event), as opposed to a real one. Returns: true if this event is emulated
bool getRootCoords(out double xRoot, out double yRoot)Extract the root window relative x/y coordinates from an event.
int getScancode()Gets the keyboard low-level scancode of a key event.
gdk.screen.Screen getScreen()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 - tha...
bool getScrollDeltas(out double deltaX, out double deltaY)Retrieves the scroll deltas from a #GdkEvent
bool getScrollDirection(out gdk.types.ScrollDirection direction)Extracts the scroll direction from an event.
gdk.seat.Seat getSeat()Returns the #GdkSeat this event was generated for. Returns: The #GdkSeat of this event
gdk.device.Device getSourceDevice()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 i...
bool getState(out gdk.types.ModifierType state)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...
uint getTime()Returns the time stamp from event, if there is one; otherwise returns #GDKCURRENTTIME. If event is null, returns #GDKCURRENTTIME. Returns: time stamp field from event
gdk.window.Window getWindow()Extracts the #GdkWindow associated with an event. Returns: The #GdkWindow associated with the event
bool isScrollStopEvent()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...
void put()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].
void setDevice(gdk.device.Device device)Sets the device for event to device. The event must have been allocated by GTK+, for instance, by [gdk.event.Event.copy].
void setDeviceTool(gdk.device_tool.DeviceTool tool = null)Sets the device tool for this event, should be rarely used.
void setScreen(gdk.screen.Screen screen)Sets the screen for event to screen. The event must have been allocated by GTK+, for instance, by [gdk.event.Event.copy].
void setSourceDevice(gdk.device.Device device)Sets the slave device for event to device.
bool triggersContextMenu()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....
gdk.event.Event get()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]. Returns: the next #GdkEvent to be...
void handlerSet(gdk.types.EventFunc func)Sets the function to call to handle all events from GDK.
gdk.event.Event peek()If there is an event waiting in the event queue of some open display, returns a copy of it. See [gdk.display.Display.peekEvent]. Returns: a copy of the first #GdkEvent on some event queue, or null ...
void requestMotions(gdk.event_motion.EventMotion event)Request more motion notifies if event is a motion notify hint event.
Constructors
this(void * ptr, Flag!"Take" take)
this(gdk.types.EventType type)Creates a new event of the given type. All fields are set to 0.