1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Functions for handling events from the window system
7 <!-- ##### SECTION Long_Description ##### -->
9 This section describes functions dealing with events from the window system.
12 In GTK+ applications the events are handled automatically in
13 gtk_main_do_event() and passed on to the appropriate widgets, so these
14 functions are rarely needed. Though some of the fields in the
15 <link linkend="gdk-Event-Structures">Event Structures</link> are useful.
18 <!-- ##### SECTION See_Also ##### -->
22 <term><link linkend="gdk-Event-Structures">Event Structures</link></term>
24 The structs used for each type of event.
30 <!-- ##### SECTION Stability_Level ##### -->
33 <!-- ##### ENUM GdkEventType ##### -->
35 Specifies the type of the event.
38 Do not confuse these events with the signals that GTK+ widgets emit.
39 Although many of these events result in corresponding signals being emitted,
40 the events are often transformed or filtered along the way.
43 @GDK_NOTHING: a special code to indicate a null event.
44 @GDK_DELETE: the window manager has requested that the toplevel window be
45 hidden or destroyed, usually when the user clicks on a special icon in the
47 @GDK_DESTROY: the window has been destroyed.
48 @GDK_EXPOSE: all or part of the window has become visible and needs to be
50 @GDK_MOTION_NOTIFY: the pointer (usually a mouse) has moved.
51 @GDK_BUTTON_PRESS: a mouse button has been pressed.
52 @GDK_2BUTTON_PRESS: a mouse button has been double-clicked (clicked twice
53 within a short period of time). Note that each click also generates a
54 %GDK_BUTTON_PRESS event.
55 @GDK_3BUTTON_PRESS: a mouse button has been clicked 3 times in a short period
56 of time. Note that each click also generates a %GDK_BUTTON_PRESS event.
57 @GDK_BUTTON_RELEASE: a mouse button has been released.
58 @GDK_KEY_PRESS: a key has been pressed.
59 @GDK_KEY_RELEASE: a key has been released.
60 @GDK_ENTER_NOTIFY: the pointer has entered the window.
61 @GDK_LEAVE_NOTIFY: the pointer has left the window.
62 @GDK_FOCUS_CHANGE: the keyboard focus has entered or left the window.
63 @GDK_CONFIGURE: the size, position or stacking order of the window has changed.
64 Note that GTK+ discards these events for %GDK_WINDOW_CHILD windows.
65 @GDK_MAP: the window has been mapped.
66 @GDK_UNMAP: the window has been unmapped.
67 @GDK_PROPERTY_NOTIFY: a property on the window has been changed or deleted.
68 @GDK_SELECTION_CLEAR: the application has lost ownership of a selection.
69 @GDK_SELECTION_REQUEST: another application has requested a selection.
70 @GDK_SELECTION_NOTIFY: a selection has been received.
71 @GDK_PROXIMITY_IN: an input device has moved into contact with a sensing
72 surface (e.g. a touchscreen or graphics tablet).
73 @GDK_PROXIMITY_OUT: an input device has moved out of contact with a sensing
75 @GDK_DRAG_ENTER: the mouse has entered the window while a drag is in progress.
76 @GDK_DRAG_LEAVE: the mouse has left the window while a drag is in progress.
77 @GDK_DRAG_MOTION: the mouse has moved in the window while a drag is in
79 @GDK_DRAG_STATUS: the status of the drag operation initiated by the window
81 @GDK_DROP_START: a drop operation onto the window has started.
82 @GDK_DROP_FINISHED: the drop operation initiated by the window has completed.
83 @GDK_CLIENT_EVENT: a message has been received from another application.
84 @GDK_VISIBILITY_NOTIFY: the window visibility status has changed.
85 @GDK_NO_EXPOSE: indicates that the source region was completely available
86 when parts of a drawable were copied. This is not very useful.
87 @GDK_SCROLL: the scroll wheel was turned
88 @GDK_WINDOW_STATE: the state of a window has changed. See #GdkWindowState
89 for the possible window states
90 @GDK_SETTING: a setting has been modified.
91 @GDK_OWNER_CHANGE: the owner of a selection has changed. This event type
94 <!-- ##### ENUM GdkEventMask ##### -->
96 A set of bit-flags to indicate which events a window is to receive.
97 Most of these masks map onto one or more of the #GdkEventType event types
101 %GDK_POINTER_MOTION_HINT_MASK is a special mask which is used to reduce the
102 number of %GDK_MOTION_NOTIFY events received. Normally a %GDK_MOTION_NOTIFY
103 event is received each time the mouse moves. However, if the application
104 spends a lot of time processing the event (updating the display, for example),
105 it can easily lag behind the position of the mouse. When using the
106 %GDK_POINTER_MOTION_HINT_MASK the server will only send a single %GDK_MOTION_NOTIFY
107 event (which is marked as a hint) until the application asks for more, by calling
108 gdk_window_get_pointer().
112 @GDK_POINTER_MOTION_MASK:
113 @GDK_POINTER_MOTION_HINT_MASK:
114 @GDK_BUTTON_MOTION_MASK:
115 @GDK_BUTTON1_MOTION_MASK:
116 @GDK_BUTTON2_MOTION_MASK:
117 @GDK_BUTTON3_MOTION_MASK:
118 @GDK_BUTTON_PRESS_MASK:
119 @GDK_BUTTON_RELEASE_MASK:
121 @GDK_KEY_RELEASE_MASK:
122 @GDK_ENTER_NOTIFY_MASK:
123 @GDK_LEAVE_NOTIFY_MASK:
124 @GDK_FOCUS_CHANGE_MASK:
126 @GDK_PROPERTY_CHANGE_MASK:
127 @GDK_VISIBILITY_NOTIFY_MASK:
128 @GDK_PROXIMITY_IN_MASK:
129 @GDK_PROXIMITY_OUT_MASK:
130 @GDK_SUBSTRUCTURE_MASK:
132 @GDK_ALL_EVENTS_MASK: the combination of all the above event masks.
134 <!-- ##### MACRO GDK_CURRENT_TIME ##### -->
136 Represents the current time, and can be used anywhere a time is expected.
141 <!-- ##### MACRO GDK_PRIORITY_EVENTS ##### -->
143 This is the priority that events from the X server are given in the
144 <link linkend="glib-The-Main-Event-Loop">GLib Main Loop</link>.
149 <!-- ##### MACRO GDK_PRIORITY_REDRAW ##### -->
151 This is the priority that the idle handler processing window updates
152 is given in the <link linkend="glib-The-Main-Event-Loop">GLib Main Loop</link>.
157 <!-- ##### FUNCTION gdk_events_pending ##### -->
164 <!-- ##### FUNCTION gdk_event_peek ##### -->
171 <!-- ##### FUNCTION gdk_event_get ##### -->
178 <!-- ##### FUNCTION gdk_event_get_graphics_expose ##### -->
186 <!-- ##### FUNCTION gdk_event_put ##### -->
193 <!-- ##### FUNCTION gdk_event_new ##### -->
202 <!-- ##### FUNCTION gdk_event_copy ##### -->
210 <!-- ##### FUNCTION gdk_event_free ##### -->
217 <!-- ##### FUNCTION gdk_event_get_time ##### -->
225 <!-- ##### FUNCTION gdk_event_get_state ##### -->
235 <!-- ##### FUNCTION gdk_event_get_axis ##### -->
246 <!-- ##### FUNCTION gdk_event_get_coords ##### -->
257 <!-- ##### FUNCTION gdk_event_get_root_coords ##### -->
268 <!-- ##### FUNCTION gdk_event_handler_set ##### -->
277 <!-- ##### USER_FUNCTION GdkEventFunc ##### -->
279 Specifies the type of function passed to gdk_event_handler_set() to handle
283 @event: the #GdkEvent to process.
284 @data: user data set when the event handler was installed with
285 gdk_event_handler_set().
288 <!-- ##### FUNCTION gdk_event_send_client_message ##### -->
295 <!-- # Unused Parameters # -->
299 <!-- ##### FUNCTION gdk_event_send_client_message_for_display ##### -->
308 <!-- # Unused Parameters # -->
312 <!-- ##### FUNCTION gdk_event_send_clientmessage_toall ##### -->
319 <!-- ##### FUNCTION gdk_add_client_message_filter ##### -->
328 <!-- ##### FUNCTION gdk_get_show_events ##### -->
335 <!-- ##### FUNCTION gdk_set_show_events ##### -->
342 <!-- ##### FUNCTION gdk_event_set_screen ##### -->
351 <!-- ##### FUNCTION gdk_event_get_screen ##### -->
360 <!-- ##### FUNCTION gdk_setting_get ##### -->