docs/html/sdlseteventfilter.html
changeset 3352 6dc250ebdd80
parent 3351 8e0182c236d8
child 3353 6b14223dd5c7
     1.1 --- a/docs/html/sdlseteventfilter.html	Wed Oct 07 06:11:53 2009 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,284 +0,0 @@
     1.4 -<HTML
     1.5 -><HEAD
     1.6 -><TITLE
     1.7 ->SDL_SetEventFilter</TITLE
     1.8 -><META
     1.9 -NAME="GENERATOR"
    1.10 -CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
    1.11 -"><LINK
    1.12 -REL="HOME"
    1.13 -TITLE="SDL Library Documentation"
    1.14 -HREF="index.html"><LINK
    1.15 -REL="UP"
    1.16 -TITLE="Event Functions."
    1.17 -HREF="eventfunctions.html"><LINK
    1.18 -REL="PREVIOUS"
    1.19 -TITLE="SDL_PushEvent"
    1.20 -HREF="sdlpushevent.html"><LINK
    1.21 -REL="NEXT"
    1.22 -TITLE="SDL_GetEventFilter"
    1.23 -HREF="sdlgeteventfilter.html"></HEAD
    1.24 -><BODY
    1.25 -CLASS="REFENTRY"
    1.26 -BGCOLOR="#FFF8DC"
    1.27 -TEXT="#000000"
    1.28 -LINK="#0000ee"
    1.29 -VLINK="#551a8b"
    1.30 -ALINK="#ff0000"
    1.31 -><DIV
    1.32 -CLASS="NAVHEADER"
    1.33 -><TABLE
    1.34 -SUMMARY="Header navigation table"
    1.35 -WIDTH="100%"
    1.36 -BORDER="0"
    1.37 -CELLPADDING="0"
    1.38 -CELLSPACING="0"
    1.39 -><TR
    1.40 -><TH
    1.41 -COLSPAN="3"
    1.42 -ALIGN="center"
    1.43 ->SDL Library Documentation</TH
    1.44 -></TR
    1.45 -><TR
    1.46 -><TD
    1.47 -WIDTH="10%"
    1.48 -ALIGN="left"
    1.49 -VALIGN="bottom"
    1.50 -><A
    1.51 -HREF="sdlpushevent.html"
    1.52 -ACCESSKEY="P"
    1.53 ->Prev</A
    1.54 -></TD
    1.55 -><TD
    1.56 -WIDTH="80%"
    1.57 -ALIGN="center"
    1.58 -VALIGN="bottom"
    1.59 -></TD
    1.60 -><TD
    1.61 -WIDTH="10%"
    1.62 -ALIGN="right"
    1.63 -VALIGN="bottom"
    1.64 -><A
    1.65 -HREF="sdlgeteventfilter.html"
    1.66 -ACCESSKEY="N"
    1.67 ->Next</A
    1.68 -></TD
    1.69 -></TR
    1.70 -></TABLE
    1.71 -><HR
    1.72 -ALIGN="LEFT"
    1.73 -WIDTH="100%"></DIV
    1.74 -><H1
    1.75 -><A
    1.76 -NAME="SDLSETEVENTFILTER"
    1.77 -></A
    1.78 ->SDL_SetEventFilter</H1
    1.79 -><DIV
    1.80 -CLASS="REFNAMEDIV"
    1.81 -><A
    1.82 -NAME="AEN5575"
    1.83 -></A
    1.84 -><H2
    1.85 ->Name</H2
    1.86 ->SDL_SetEventFilter&nbsp;--&nbsp;Sets up a filter to process all events before they are posted 
    1.87 -to the event queue.</DIV
    1.88 -><DIV
    1.89 -CLASS="REFSYNOPSISDIV"
    1.90 -><A
    1.91 -NAME="AEN5578"
    1.92 -></A
    1.93 -><H2
    1.94 ->Synopsis</H2
    1.95 -><DIV
    1.96 -CLASS="FUNCSYNOPSIS"
    1.97 -><A
    1.98 -NAME="AEN5579"
    1.99 -></A
   1.100 -><P
   1.101 -></P
   1.102 -><PRE
   1.103 -CLASS="FUNCSYNOPSISINFO"
   1.104 ->#include "SDL.h"</PRE
   1.105 -><P
   1.106 -><CODE
   1.107 -><CODE
   1.108 -CLASS="FUNCDEF"
   1.109 ->void <B
   1.110 -CLASS="FSFUNC"
   1.111 ->SDL_SetEventFilter</B
   1.112 -></CODE
   1.113 ->(SDL_EventFilter filter);</CODE
   1.114 -></P
   1.115 -><P
   1.116 -></P
   1.117 -></DIV
   1.118 -></DIV
   1.119 -><DIV
   1.120 -CLASS="REFSECT1"
   1.121 -><A
   1.122 -NAME="AEN5585"
   1.123 -></A
   1.124 -><H2
   1.125 ->Description</H2
   1.126 -><P
   1.127 ->This function sets up a filter to process all events before they are posted 
   1.128 -to the event queue.  This is a very powerful and flexible feature.  The filter 
   1.129 -is prototyped as:
   1.130 -<PRE
   1.131 -CLASS="PROGRAMLISTING"
   1.132 ->typedef int (*SDL_EventFilter)(const SDL_Event *event);</PRE
   1.133 ->
   1.134 -If the filter returns <SPAN
   1.135 -CLASS="RETURNVALUE"
   1.136 ->1</SPAN
   1.137 ->, then the event will be 
   1.138 -added to the internal queue.  If it returns <SPAN
   1.139 -CLASS="RETURNVALUE"
   1.140 ->0</SPAN
   1.141 ->, 
   1.142 -then the event will be dropped from the queue.  This allows selective
   1.143 -filtering of dynamically.</P
   1.144 -><P
   1.145 ->There is one caveat when dealing with the <TT
   1.146 -CLASS="LITERAL"
   1.147 ->SDL_QUITEVENT</TT
   1.148 -> event type.  The
   1.149 -event filter is only called when the window manager desires to close the
   1.150 -application window.  If the event filter returns 1, then the window will
   1.151 -be closed, otherwise the window will remain open if possible.
   1.152 -If the quit event is generated by an interrupt signal, it will bypass the
   1.153 -internal queue and be delivered to the application at the next event poll.</P
   1.154 -><DIV
   1.155 -CLASS="NOTE"
   1.156 -><BLOCKQUOTE
   1.157 -CLASS="NOTE"
   1.158 -><P
   1.159 -><B
   1.160 ->Note: </B
   1.161 ->Events pushed onto the queue with <A
   1.162 -HREF="sdlpushevent.html"
   1.163 -><TT
   1.164 -CLASS="FUNCTION"
   1.165 ->SDL_PushEvent</TT
   1.166 -></A
   1.167 -> or <A
   1.168 -HREF="sdlpeepevents.html"
   1.169 -><TT
   1.170 -CLASS="FUNCTION"
   1.171 ->SDL_PeepEvents</TT
   1.172 -></A
   1.173 -> do not get passed through the event filter.</P
   1.174 -></BLOCKQUOTE
   1.175 -></DIV
   1.176 -><DIV
   1.177 -CLASS="NOTE"
   1.178 -><BLOCKQUOTE
   1.179 -CLASS="NOTE"
   1.180 -><P
   1.181 -><B
   1.182 ->Note: </B
   1.183 -><SPAN
   1.184 -CLASS="emphasis"
   1.185 -><I
   1.186 -CLASS="EMPHASIS"
   1.187 ->Be Careful!</I
   1.188 -></SPAN
   1.189 -> The event filter function may run in a different thread so be careful what you do within it.</P
   1.190 -></BLOCKQUOTE
   1.191 -></DIV
   1.192 -></DIV
   1.193 -><DIV
   1.194 -CLASS="REFSECT1"
   1.195 -><A
   1.196 -NAME="AEN5602"
   1.197 -></A
   1.198 -><H2
   1.199 ->See Also</H2
   1.200 -><P
   1.201 -><A
   1.202 -HREF="sdlevent.html"
   1.203 -><SPAN
   1.204 -CLASS="STRUCTNAME"
   1.205 ->SDL_Event</SPAN
   1.206 -></A
   1.207 ->,
   1.208 -<A
   1.209 -HREF="sdlgeteventfilter.html"
   1.210 -><TT
   1.211 -CLASS="FUNCTION"
   1.212 ->SDL_GetEventFilter</TT
   1.213 -></A
   1.214 ->,
   1.215 -<A
   1.216 -HREF="sdlpushevent.html"
   1.217 -><TT
   1.218 -CLASS="FUNCTION"
   1.219 ->SDL_PushEvent</TT
   1.220 -></A
   1.221 -></P
   1.222 -></DIV
   1.223 -><DIV
   1.224 -CLASS="NAVFOOTER"
   1.225 -><HR
   1.226 -ALIGN="LEFT"
   1.227 -WIDTH="100%"><TABLE
   1.228 -SUMMARY="Footer navigation table"
   1.229 -WIDTH="100%"
   1.230 -BORDER="0"
   1.231 -CELLPADDING="0"
   1.232 -CELLSPACING="0"
   1.233 -><TR
   1.234 -><TD
   1.235 -WIDTH="33%"
   1.236 -ALIGN="left"
   1.237 -VALIGN="top"
   1.238 -><A
   1.239 -HREF="sdlpushevent.html"
   1.240 -ACCESSKEY="P"
   1.241 ->Prev</A
   1.242 -></TD
   1.243 -><TD
   1.244 -WIDTH="34%"
   1.245 -ALIGN="center"
   1.246 -VALIGN="top"
   1.247 -><A
   1.248 -HREF="index.html"
   1.249 -ACCESSKEY="H"
   1.250 ->Home</A
   1.251 -></TD
   1.252 -><TD
   1.253 -WIDTH="33%"
   1.254 -ALIGN="right"
   1.255 -VALIGN="top"
   1.256 -><A
   1.257 -HREF="sdlgeteventfilter.html"
   1.258 -ACCESSKEY="N"
   1.259 ->Next</A
   1.260 -></TD
   1.261 -></TR
   1.262 -><TR
   1.263 -><TD
   1.264 -WIDTH="33%"
   1.265 -ALIGN="left"
   1.266 -VALIGN="top"
   1.267 ->SDL_PushEvent</TD
   1.268 -><TD
   1.269 -WIDTH="34%"
   1.270 -ALIGN="center"
   1.271 -VALIGN="top"
   1.272 -><A
   1.273 -HREF="eventfunctions.html"
   1.274 -ACCESSKEY="U"
   1.275 ->Up</A
   1.276 -></TD
   1.277 -><TD
   1.278 -WIDTH="33%"
   1.279 -ALIGN="right"
   1.280 -VALIGN="top"
   1.281 ->SDL_GetEventFilter</TD
   1.282 -></TR
   1.283 -></TABLE
   1.284 -></DIV
   1.285 -></BODY
   1.286 -></HTML
   1.287 ->
   1.288 \ No newline at end of file