| gdk-Event-Structures {RGtk2} | R Documentation |
Data structures specific to each type of event
The event structs contain data specific to each type of event in GDK.
PLEASE NOTE: A common mistake is to forget to set the event mask of a widget so that the
required events are received. See gtkWidgetSetEvents.
GdkEventAnyGdkEventAny to access
these fields.
typeGdkEventType] the type of the event.windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using
xsendevent).
GdkEventKeytypeGdkEventType] the type of the event (GDK_KEY_PRESS or GDK_KEY_RELEASE).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using
xsendevent).timestateGdkModifierType.keyvallengthstring.stringGtkIMContext), so this
field is deprecated and should never be used.
(gdkUnicodeToKeyval provides a non-deprecated way of getting
an approximate translation for a key.) The string is encoded in the encoding
of the current locale (Note: this for backwards compatibility:
strings in GTK+ and GDK are typically in UTF-8.) and NUL-terminated.
In some cases, the translation of the key code will be a single
NUL byte, in which case looking at length is necessary to distinguish
it from the an empty translation.hardwareKeycodegroup
GdkEventButtontype field will be one of GDK_BUTTON_PRESS,
GDK_2BUTTON_PRESS, GDK_3BUTTON_PRESS, and GDK_BUTTON_RELEASE.
Double and triple-clicks result in a sequence of events being received. For double-clicks the order of events will be:
GDK_BUTTON_PRESS
GDK_BUTTON_RELEASE
GDK_BUTTON_PRESS
GDK_2BUTTON_PRESS
GDK_BUTTON_RELEASE
Note that the first click is received just like a normal
button press, while the second click results in a GDK_2BUTTON_PRESS being
received just after the GDK_BUTTON_PRESS.
Triple-clicks are very similar to double-clicks, except that GDK_3BUTTON_PRESS
is inserted after the third click. The order of the events is:
GDK_BUTTON_PRESS
GDK_BUTTON_RELEASE
GDK_BUTTON_PRESS
GDK_2BUTTON_PRESS
GDK_BUTTON_RELEASE
GDK_BUTTON_PRESS
GDK_3BUTTON_PRESS
GDK_BUTTON_RELEASE
For a double click to occur, the second button press must occur within 1/4 of a second of the first. For a triple click to occur, the third button press must also occur within 1/2 second of the first button press.
typeGdkEventType] the type of the event (GDK_BUTTON_PRESS, GDK_2BUTTON_PRESS,
GDK_3BUTTON_PRESS or GDK_BUTTON_RELEASE).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using
xsendevent).timexyaxesx, y translated to the axes of device, or NULL if device is
the mouse.stateGdkModifierType.buttondeviceGdkDevice] the device where the event originated.xRootyRoot
GdkEventScrolltypeGdkEventType] the type of the event (GDK_SCROLL).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using
xsendevent).timexystateGdkModifierType.directionGdkScrollDirection] the direction to scroll to (one of GDK_SCROLL_UP,
GDK_SCROLL_DOWN, GDK_SCROLL_LEFT and GDK_SCROLL_RIGHT).deviceGdkDevice] the device where the event originated.xRootyRoot
GdkEventMotiontypeGdkEventType] the type of the event.windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using
xsendevent).timexyaxesx, y translated to the axes of device, or NULL if device is
the mouse.stateGdkModifierType.isHintGDK_POINTER_MOTION_HINT_MASK
value of GdkEventMask.deviceGdkDevice] the device where the event originated.xRootyRoot
GdkEventExposetypeGdkEventType] the type of the event (GDK_EXPOSE).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using
xsendevent).areaGdkRectangle] bounding box of region.regionGdkRegion] the region that needs to be redrawn.countGDK_EXPOSE events following this one.
The only use for this is "exposure compression", i.e. handling all contiguous
GDK_EXPOSE events in one go, though GDK performs some exposure compression
so this is not normally needed.
GdkEventVisibilitytypeGdkEventType] the type of the event (GDK_VISIBILITY_NOTIFY).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using
xsendevent).stateGdkVisibilityState] the new visibility state (GDK_VISIBILITY_FULLY_OBSCURED,
GDK_VISIBILITY_PARTIAL or GDK_VISIBILITY_UNOBSCURED).
GdkEventCrossingtypeGdkEventType] the type of the event (GDK_ENTER_NOTIFY or GDK_LEAVE_NOTIFY).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using
xsendevent).contextGdkDragContext] the window that was entered or left.timexRootyRoot
GdkEventFocustypeGdkEventType] the type of the event (GDK_FOCUS_CHANGE).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using xsendevent).inTRUE if the window has gained the keyboard focus, FALSE if it has lost
the focus.
GdkEventConfiguretypeGdkEventType] the type of the event (GDK_CONFIGURE).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using xsendevent).xywidthheight
GdkEventPropertytypeGdkEventType] the type of the event (GDK_PROPERTY_NOTIFY).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using xsendevent).atomGdkAtom] the property that was changed.timestateGDK_PROPERTY_NEW_VALUE) or
deleted (GDK_PROPERTY_DELETE).
GdkEventSelectiontypeGdkEventType] the type of the event (GDK_SELECTION_CLEAR, GDK_SELECTION_NOTIFY or
GDK_SELECTION_REQUEST).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using xsendevent).selectionGdkAtom] the selection.targetGdkAtom] the target to which the selection should be converted.propertyGdkAtom] the property in which to place the result of the conversion.timerequestorGdkNativeWindow] the native window on which to place property.
GdkEventDNDtypeGdkEventType] the type of the event (GDK_DRAG_ENTER, GDK_DRAG_LEAVE,
GDK_DRAG_MOTION, GDK_DRAG_STATUS, GDK_DROP_START or GDK_DROP_FINISHED).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using xsendevent).contextGdkDragContext] the GdkDragContext for the current DND operation.timexRootGDK_DRAG_MOTION and GDK_DROP_START.yRootGDK_DRAG_MOTION and GDK_DROP_START.
GdkEventProximitytypeGdkEventType] the type of the event (GDK_PROXIMITY_IN or GDK_PROXIMITY_OUT).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using xsendevent).timedeviceGdkDevice] the device where the event originated.
GdkEventClienttypeGdkEventType] the type of the event (GDK_CLIENT_EVENT).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using xsendevent).messageTypeGdkAtom] the type of the message, which can be defined by the
application.
GdkEventNoExposeGdkDrawable being copied, with gdkDrawDrawable
or gdkWindowCopyArea(), was completely available.
FIXME: add more here.
typeGdkEventType] the type of the event (GDK_NO_EXPOSE).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using xsendevent).
GdkEventWindowStatetypeGdkEventType] the type of the event (GDK_WINDOW_STATE).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using xsendevent).changedMaskGdkWindowState] mask specifying what flags have changed.newWindowStateGdkWindowState] the new window state, a combination of GdkWindowState bits.
GdkEventSettingtypeGdkEventType] the type of the event (GDK_SETTING).windowGdkWindow] the window which received the event.sendEventTRUE if the event was sent explicitly (e.g. using xsendevent).actionGdkSettingAction] what happened to the setting (GDK_SETTING_ACTION_NEW,
GDK_SETTING_ACTION_CHANGED or GDK_SETTING_ACTION_DELETED).name
GdkEventOwnerChangetypeGdkEventType] the type of the event (GDK_OWNER_CHANGE).windowGdkWindow] the window which received the eventsendEventTRUE if the event was sent explicitly (e.g. using xsendevent).ownerGdkNativeWindow] the new owner of the selectionreasonGdkOwnerChange] the reason for the ownership change as a GdkOwnerChange valueselectionGdkAtom] the atom identifying the selectiontimeselectionTime
GdkEventGrabBrokenGdkEventGrabBroken events.
Since 2.8
typeGdkEventType] the type of the event (GDK_GRAB_BROKEN)windowGdkWindow] the window which received the event, i.e. the window
that previously owned the grabsendEventTRUE if the event was sent explicitly (e.g. using xsendevent).keyboardTRUE if a keyboard grab was broken, FALSE if a pointer
grab was brokenimplicitTRUE if the broken grab was implicitgrabWindowGdkWindow] If this event is caused by another grab in the same
application, grab.window contains the new grab window. Otherwise
grab.window is NULL.
GdkScrollDirectionGdkEventScroll.
updownleftright
GdkVisibilityStateGdkEventVisibility.
unobscuredpartialfully-obscured
GdkCrossingModeGdkEventCrossing.
normalgrabungrab
GdkNotifyTypeGdkEventCrossing.
See the X11 protocol specification of LeaveNotify for
full details of crossing event generation.
ancestorvirtualinferiornonlinearnonlinear-virtualunknown
GdkPropertyStateGdkEventProperty.
new-valuedelete
GdkWindowStatewithdrawniconifiedmaximizedstickyfullscreenabovebelow
GdkSettingActionGdkEventSetting.
newchangeddeleted
GdkOwnerChangenew-ownerdestroyclose
Derived by RGtkGen from GTK+ documentation
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Event-Structures.html