gdk.event
Module for [Event] class
class Event
Types 1
classEvent : gobject.boxed.Boxed
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 type(gdk.types.EventType propval) @property nothrowSet `type` field. Params: propval = the #GdkEventTypegdk.event_expose.EventExpose expose() @property nothrowGet `expose` field. Returns: a #GdkEventExposegdk.event_visibility.EventVisibility visibility() @property nothrowGet `visibility` field. Returns: a #GdkEventVisibilitygdk.event_motion.EventMotion motion() @property nothrowGet `motion` field. Returns: a #GdkEventMotiongdk.event_button.EventButton button() @property nothrowGet `button` field. Returns: a #GdkEventButtongdk.event_scroll.EventScroll scroll() @property nothrowGet `scroll` field. Returns: a #GdkEventScrollgdk.event_crossing.EventCrossing crossing() @property nothrowGet `crossing` field. Returns: a #GdkEventCrossinggdk.event_focus.EventFocus focusChange() @property nothrowGet `focusChange` field. Returns: a #GdkEventFocusgdk.event_configure.EventConfigure configure() @property nothrowGet `configure` field. Returns: a #GdkEventConfiguregdk.event_property.EventProperty property() @property nothrowGet `property` field. Returns: a #GdkEventPropertygdk.event_selection.EventSelection selection() @property nothrowGet `selection` field. Returns: a #GdkEventSelectiongdk.event_owner_change.EventOwnerChange ownerChange() @property nothrowGet `ownerChange` field. Returns: a #GdkEventOwnerChangegdk.event_proximity.EventProximity proximity() @property nothrowGet `proximity` field. Returns: a #GdkEventProximitygdk.event_window_state.EventWindowState windowState() @property nothrowGet `windowState` field. Returns: a #GdkEventWindowStategdk.event_setting.EventSetting setting() @property nothrowGet `setting` field. Returns: a #GdkEventSettinggdk.event_grab_broken.EventGrabBroken grabBroken() @property nothrowGet `grabBroken` field. Returns: a #GdkEventGrabBrokengdk.event_touchpad_swipe.EventTouchpadSwipe touchpadSwipe() @property nothrowGet `touchpadSwipe` field. Returns: a #GdkEventTouchpadSwipegdk.event_touchpad_pinch.EventTouchpadPinch touchpadPinch() @property nothrowGet `touchpadPinch` field. Returns: a #GdkEventTouchpadPinchgdk.event_pad_button.EventPadButton padButton() @property nothrowGet `padButton` field. Returns: a #GdkEventPadButtongdk.event_pad_axis.EventPadAxis padAxis() @property nothrowGet `padAxis` field. Returns: a #GdkEventPadAxisgdk.event_pad_group_mode.EventPadGroupMode padGroupMode() @property nothrowGet `padGroupMode` field. Returns: a #GdkEventPadGroupModegdk.event.Event copy() nothrowCopies 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) nothrowExtract the axis value for a particular axis use from an event structure.bool getCoords(out double xWin, out double yWin) nothrowExtract the event window relative x/y coordinates from an event.gdk.device.Device getDevice() nothrowIf 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() nothrowIf 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() nothrowIf 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 ...bool getPointerEmulated() nothrow#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 emulatedbool getRootCoords(out double xRoot, out double yRoot) nothrowExtract the root window relative x/y coordinates from an event.gdk.screen.Screen getScreen() nothrowReturns 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) nothrowRetrieves the scroll deltas from a #GdkEventbool getScrollDirection(out gdk.types.ScrollDirection direction) nothrowExtracts the scroll direction from an event.gdk.seat.Seat getSeat() nothrowReturns the #GdkSeat this event was generated for. Returns: The #GdkSeat of this eventgdk.device.Device getSourceDevice() nothrowThis 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) nothrowIf 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() nothrowReturns the time stamp from event, if there is one; otherwise returns #GDK_CURRENT_TIME. If event is null, returns #GDK_CURRENT_TIME. Returns: time stamp field from eventgdk.window.Window getWindow() nothrowExtracts the #GdkWindow associated with an event. Returns: The #GdkWindow associated with the eventbool isScrollStopEvent() nothrowCheck 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() nothrowAppends 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) nothrowSets 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) nothrowSets the device tool for this event, should be rarely used.void setScreen(gdk.screen.Screen screen) nothrowSets the screen for event to screen. The event must have been allocated by GTK+, for instance, by [gdk.event.Event.copy].bool triggersContextMenu() nothrowThis 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() static nothrowChecks 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) static nothrowSets the function to call to handle all events from GDK.gdk.event.Event peek() static nothrowIf 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) static nothrowRequest more motion notifies if event is a motion notify hint event.Constructors
this(gdk.types.EventType type)Creates a new event of the given type. All fields are set to 0.