Description Methods and Functions Detailed Description Enums and Flags User Functions Author(s) References
Functions for handling events from the window system
gdkEventsPending()
gdkEventPeek()
gdkEventGet()
gdkEventGetGraphicsExpose(window)
gdkEventPut(object)
gdkEventNew(type)
gdkEventCopy(object)
gdkEventGetTime(object)
gdkEventGetState(object)
gdkEventGetAxis(object, axis.use)
gdkEventGetCoords(object)
gdkEventGetRootCoords(object)
gdkEventRequestMotions(event)
gdkEventHandlerSet(func, data)
gdkAddClientMessageFilter(message.type, func, data)
gdkGetShowEvents()
gdkSetShowEvents(show.events)
gdkEventSetScreen(object, screen)
gdkEventGetScreen(object)
gdkSettingGet(name)
This section describes functions dealing with events from the window system.
In GTK+ applications the events are handled automatically in
gtkMainDoEvent
and passed on to the appropriate widgets, so these
functions are rarely needed. Though some of the fields in the
Event Structures are useful.
GdkEventType
Specifies the type of the event.
Do not confuse these events with the signals that GTK+ widgets emit. Although many of these events result in corresponding signals being emitted, the events are often transformed or filtered along the way.
nothing
a special code to indicate a null event.
delete
the window manager has requested that the toplevel window be hidden or destroyed, usually when the user clicks on a special icon in the title bar.
destroy
the window has been destroyed.
expose
all or part of the window has become visible and needs to be redrawn.
motion-notify
the pointer (usually a mouse) has moved.
button-press
a mouse button has been pressed.
2button-press
a mouse button has been double-clicked (clicked twice
within a short period of time). Note that each click also generates a
GDK_BUTTON_PRESS
event.
3button-press
a mouse button has been clicked 3 times in a short period
of time. Note that each click also generates a GDK_BUTTON_PRESS
event.
button-release
a mouse button has been released.
key-press
a key has been pressed.
key-release
a key has been released.
enter-notify
the pointer has entered the window.
leave-notify
the pointer has left the window.
focus-change
the keyboard focus has entered or left the window.
configure
the size, position or stacking order of the window has changed.
Note that GTK+ discards these events for GDK_WINDOW_CHILD
windows.
map
the window has been mapped.
unmap
the window has been unmapped.
property-notify
a property on the window has been changed or deleted.
selection-clear
the application has lost ownership of a selection.
selection-request
another application has requested a selection.
selection-notify
a selection has been received.
proximity-in
an input device has moved into contact with a sensing surface (e.g. a touchscreen or graphics tablet).
proximity-out
an input device has moved out of contact with a sensing surface.
drag-enter
the mouse has entered the window while a drag is in progress.
drag-leave
the mouse has left the window while a drag is in progress.
drag-motion
the mouse has moved in the window while a drag is in progress.
drag-status
the status of the drag operation initiated by the window has changed.
drop-start
a drop operation onto the window has started.
drop-finished
the drop operation initiated by the window has completed.
client-event
a message has been received from another application.
visibility-notify
the window visibility status has changed.
no-expose
indicates that the source region was completely available when parts of a drawable were copied. This is not very useful.
scroll
the scroll wheel was turned
window-state
the state of a window has changed. See GdkWindowState
for the possible window states
setting
a setting has been modified.
owner-change
the owner of a selection has changed. This event type was added in 2.6
grab-broken
a pointer or keyboard grab was broken. This event type was added in 2.8.
gdk-damage
the content of the window has been changed. This event type was added in 2.14.
GdkEventMask
A set of bit-flags to indicate which events a window is to receive.
Most of these masks map onto one or more of the GdkEventType
event types
above.
GDK_POINTER_MOTION_HINT_MASK
is a special mask which is used to reduce the
number of GDK_MOTION_NOTIFY
events received. Normally a GDK_MOTION_NOTIFY
event is received each time the mouse moves. However, if the application
spends a lot of time processing the event (updating the display, for example),
it can lag behind the position of the mouse. When using
GDK_POINTER_MOTION_HINT_MASK
, fewer GDK_MOTION_NOTIFY
events will be sent,
some of which are marked as a hint (the is_hint member is TRUE
).
To receive more motion events after a motion hint event, the application
needs to asks for more, by calling gdkEventRequestMotions
.
exposure-mask
receive expose events
pointer-motion-mask
receive all pointer motion events
pointer-motion-hint-mask
see the explanation above
button-motion-mask
receive pointer motion events while any button is pressed
button1-motion-mask
receive pointer motion events while 1 button is pressed
button2-motion-mask
receive pointer motion events while 2 button is pressed
button3-motion-mask
receive pointer motion events while 3 button is pressed
button-press-mask
receive button press events
button-release-mask
receive button release events
key-press-mask
receive key press events
key-release-mask
receive key release events
enter-notify-mask
receive window enter events
leave-notify-mask
receive window leave events
focus-change-mask
receive focus change events
structure-mask
receive events about window configuration change
property-change-mask
receive property change events
visibility-notify-mask
receive visibility change events
proximity-in-mask
receive proximity in events
proximity-out-mask
receive proximity out events
substructure-mask
receive events about window configuration changes of child windows
scroll-mask
receive scroll events
all-events-mask
the combination of all the above event masks.
GdkEventFunc(event, data)
Specifies the type of function passed to gdkEventHandlerSet
to handle
all GDK events.
event
the GdkEvent
to process.
data
user data set when the event handler was installed with
gdkEventHandlerSet
.
Derived by RGtkGen from GTK+ documentation
https://developer.gnome.org/gdk2/stable/gdk2-Events.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.