Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5131 clevermous 1
2
>
3
>
4
>SDL_SetEventFilter
5
>
6
NAME="GENERATOR"
7
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
8
">
9
REL="HOME"
10
TITLE="SDL Library Documentation"
11
HREF="index.html">
12
REL="UP"
13
TITLE="Event Functions."
14
HREF="eventfunctions.html">
15
REL="PREVIOUS"
16
TITLE="SDL_PushEvent"
17
HREF="sdlpushevent.html">
18
REL="NEXT"
19
TITLE="SDL_GetEventFilter"
20
HREF="sdlgeteventfilter.html">
21
>
22
CLASS="REFENTRY"
23
BGCOLOR="#FFF8DC"
24
TEXT="#000000"
25
LINK="#0000ee"
26
VLINK="#551a8b"
27
ALINK="#ff0000"
28
>
29
CLASS="NAVHEADER"
30
>
31
WIDTH="100%"
32
BORDER="0"
33
CELLPADDING="0"
34
CELLSPACING="0"
35
>
36
>
37
COLSPAN="3"
38
ALIGN="center"
39
>SDL Library Documentation
40
>
41
>
42
>
43
WIDTH="10%"
44
ALIGN="left"
45
VALIGN="bottom"
46
>
47
HREF="sdlpushevent.html"
48
>Prev
49
>
50
>
51
WIDTH="80%"
52
ALIGN="center"
53
VALIGN="bottom"
54
>
55
>
56
WIDTH="10%"
57
ALIGN="right"
58
VALIGN="bottom"
59
>
60
HREF="sdlgeteventfilter.html"
61
>Next
62
>
63
>
64
>
65
>
66
ALIGN="LEFT"
67
WIDTH="100%">
68
>
69
>
70
NAME="SDLSETEVENTFILTER"
71
>SDL_SetEventFilter
72
>
73
>
74
CLASS="REFNAMEDIV"
75
>
76
NAME="AEN5032"
77
>
78
>
79
>Name
80
>SDL_SetEventFilter -- Sets up a filter to process all events before they are posted
81
to the event queue.
82
>
83
CLASS="REFSYNOPSISDIV"
84
>
85
NAME="AEN5035"
86
>
87
>
88
>Synopsis
89
>
90
CLASS="FUNCSYNOPSIS"
91
>
92
NAME="AEN5036"
93
>
94
>
95
>
96
>
97
CLASS="FUNCSYNOPSISINFO"
98
>#include "SDL.h"
99
>
100
>
101
>
102
CLASS="FUNCDEF"
103
>void 
104
CLASS="FSFUNC"
105
>SDL_SetEventFilter
106
>
107
>(SDL_EventFilter filter);
108
>
109
>
110
>
111
>
112
>
113
>
114
CLASS="REFSECT1"
115
>
116
NAME="AEN5042"
117
>
118
>
119
>Description
120
>
121
>This function sets up a filter to process all events before they are posted
122
to the event queue.  This is a very powerful and flexible feature.  The filter
123
is prototyped as:
124
125
CLASS="PROGRAMLISTING"
126
>typedef int (*SDL_EventFilter)(const SDL_Event *event);
127
>
128
If the filter returns 
129
CLASS="RETURNVALUE"
130
>1
131
>, then the event will be
132
added to the internal queue.  If it returns 
133
CLASS="RETURNVALUE"
134
>0
135
>,
136
then the event will be dropped from the queue.  This allows selective
137
filtering of dynamically.
138
>
139
>There is one caveat when dealing with the 
140
CLASS="LITERAL"
141
>SDL_QUITEVENT
142
> event type.  The
143
event filter is only called when the window manager desires to close the
144
application window.  If the event filter returns 1, then the window will
145
be closed, otherwise the window will remain open if possible.
146
If the quit event is generated by an interrupt signal, it will bypass the
147
internal queue and be delivered to the application at the next event poll.
148
>
149
CLASS="NOTE"
150
>
151
CLASS="NOTE"
152
>
153
>
154
>Note: 
155
>Events pushed onto the queue with 
156
HREF="sdlpushevent.html"
157
>
158
CLASS="FUNCTION"
159
>SDL_PushEvent
160
>
161
> or 
162
HREF="sdlpeepevents.html"
163
>
164
CLASS="FUNCTION"
165
>SDL_PeepEvents
166
>
167
> do not get passed through the event filter.
168
>
169
>
170
>
171
CLASS="NOTE"
172
>
173
CLASS="NOTE"
174
>
175
>
176
>Note: 
177
>
178
CLASS="EMPHASIS"
179
>Be Careful!
180
> The event filter function may run in a different thread so be careful what you do within it.
181
>
182
>
183
>
184
>
185
CLASS="REFSECT1"
186
>
187
NAME="AEN5059"
188
>
189
>
190
>See Also
191
>
192
>
193
HREF="sdlevent.html"
194
>
195
CLASS="STRUCTNAME"
196
>SDL_Event
197
>
198
>,
199
200
HREF="sdlgeteventfilter.html"
201
>
202
CLASS="FUNCTION"
203
>SDL_GetEventFilter
204
>
205
>,
206
207
HREF="sdlpushevent.html"
208
>
209
CLASS="FUNCTION"
210
>SDL_PushEvent
211
>
212
>
213
>
214
>
215
CLASS="NAVFOOTER"
216
>
217
ALIGN="LEFT"
218
WIDTH="100%">
219
WIDTH="100%"
220
BORDER="0"
221
CELLPADDING="0"
222
CELLSPACING="0"
223
>
224
>
225
WIDTH="33%"
226
ALIGN="left"
227
VALIGN="top"
228
>
229
HREF="sdlpushevent.html"
230
>Prev
231
>
232
>
233
WIDTH="34%"
234
ALIGN="center"
235
VALIGN="top"
236
>
237
HREF="index.html"
238
>Home
239
>
240
>
241
WIDTH="33%"
242
ALIGN="right"
243
VALIGN="top"
244
>
245
HREF="sdlgeteventfilter.html"
246
>Next
247
>
248
>
249
>
250
>
251
WIDTH="33%"
252
ALIGN="left"
253
VALIGN="top"
254
>SDL_PushEvent
255
>
256
WIDTH="34%"
257
ALIGN="center"
258
VALIGN="top"
259
>
260
HREF="eventfunctions.html"
261
>Up
262
>
263
>
264
WIDTH="33%"
265
ALIGN="right"
266
VALIGN="top"
267
>SDL_GetEventFilter
268
>
269
>
270
>
271
>
272
>
273
>