Mercurial > sdl-ios-xcode
annotate docs/html/sdlevent.html @ 2818:4e09acde4333
Added a newline, to verify that revision control is functioning.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Mon, 01 Dec 2008 09:09:31 +0000 |
parents | 85cbe9c892f4 |
children |
rev | line source |
---|---|
0 | 1 <HTML |
2 ><HEAD | |
3 ><TITLE | |
4 >SDL_Event</TITLE | |
5 ><META | |
6 NAME="GENERATOR" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ |
0 | 8 "><LINK |
9 REL="HOME" | |
10 TITLE="SDL Library Documentation" | |
11 HREF="index.html"><LINK | |
12 REL="UP" | |
13 TITLE="SDL Event Structures." | |
14 HREF="eventstructures.html"><LINK | |
15 REL="PREVIOUS" | |
16 TITLE="SDL Event Structures." | |
17 HREF="eventstructures.html"><LINK | |
18 REL="NEXT" | |
19 TITLE="SDL_ActiveEvent" | |
20 HREF="sdlactiveevent.html"></HEAD | |
21 ><BODY | |
22 CLASS="REFENTRY" | |
23 BGCOLOR="#FFF8DC" | |
24 TEXT="#000000" | |
25 LINK="#0000ee" | |
26 VLINK="#551a8b" | |
27 ALINK="#ff0000" | |
28 ><DIV | |
29 CLASS="NAVHEADER" | |
30 ><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
31 SUMMARY="Header navigation table" |
0 | 32 WIDTH="100%" |
33 BORDER="0" | |
34 CELLPADDING="0" | |
35 CELLSPACING="0" | |
36 ><TR | |
37 ><TH | |
38 COLSPAN="3" | |
39 ALIGN="center" | |
40 >SDL Library Documentation</TH | |
41 ></TR | |
42 ><TR | |
43 ><TD | |
44 WIDTH="10%" | |
45 ALIGN="left" | |
46 VALIGN="bottom" | |
47 ><A | |
48 HREF="eventstructures.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
49 ACCESSKEY="P" |
0 | 50 >Prev</A |
51 ></TD | |
52 ><TD | |
53 WIDTH="80%" | |
54 ALIGN="center" | |
55 VALIGN="bottom" | |
56 ></TD | |
57 ><TD | |
58 WIDTH="10%" | |
59 ALIGN="right" | |
60 VALIGN="bottom" | |
61 ><A | |
62 HREF="sdlactiveevent.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
63 ACCESSKEY="N" |
0 | 64 >Next</A |
65 ></TD | |
66 ></TR | |
67 ></TABLE | |
68 ><HR | |
69 ALIGN="LEFT" | |
70 WIDTH="100%"></DIV | |
71 ><H1 | |
72 ><A | |
73 NAME="SDLEVENT" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
74 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
75 >SDL_Event</H1 |
0 | 76 ><DIV |
77 CLASS="REFNAMEDIV" | |
78 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
79 NAME="AEN3711" |
0 | 80 ></A |
81 ><H2 | |
82 >Name</H2 | |
83 >SDL_Event -- General event structure</DIV | |
84 ><DIV | |
85 CLASS="REFSECT1" | |
86 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
87 NAME="AEN3714" |
0 | 88 ></A |
89 ><H2 | |
90 >Structure Definition</H2 | |
91 ><PRE | |
92 CLASS="PROGRAMLISTING" | |
93 >typedef union{ | |
94 Uint8 type; | |
95 SDL_ActiveEvent active; | |
96 SDL_KeyboardEvent key; | |
97 SDL_MouseMotionEvent motion; | |
98 SDL_MouseButtonEvent button; | |
99 SDL_JoyAxisEvent jaxis; | |
100 SDL_JoyBallEvent jball; | |
101 SDL_JoyHatEvent jhat; | |
102 SDL_JoyButtonEvent jbutton; | |
103 SDL_ResizeEvent resize; | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
104 SDL_ExposeEvent expose; |
0 | 105 SDL_QuitEvent quit; |
106 SDL_UserEvent user; | |
2278
85cbe9c892f4
Merged revision 3455 from SDL 1.2, fixing documentation typo.
Sam Lantinga <slouken@libsdl.org>
parents:
803
diff
changeset
|
107 SDL_SysWMEvent syswm; |
0 | 108 } SDL_Event;</PRE |
109 ></DIV | |
110 ><DIV | |
111 CLASS="REFSECT1" | |
112 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
113 NAME="AEN3717" |
0 | 114 ></A |
115 ><H2 | |
116 >Structure Data</H2 | |
117 ><DIV | |
118 CLASS="INFORMALTABLE" | |
119 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
120 NAME="AEN3719" |
0 | 121 ></A |
122 ><P | |
123 ></P | |
124 ><TABLE | |
125 BORDER="0" | |
126 CLASS="CALSTABLE" | |
127 ><TBODY | |
128 ><TR | |
129 ><TD | |
130 ALIGN="LEFT" | |
131 VALIGN="TOP" | |
132 ><TT | |
133 CLASS="STRUCTFIELD" | |
134 ><I | |
135 >type</I | |
136 ></TT | |
137 ></TD | |
138 ><TD | |
139 ALIGN="LEFT" | |
140 VALIGN="TOP" | |
141 >The type of event</TD | |
142 ></TR | |
143 ><TR | |
144 ><TD | |
145 ALIGN="LEFT" | |
146 VALIGN="TOP" | |
147 ><TT | |
148 CLASS="STRUCTFIELD" | |
149 ><I | |
150 >active</I | |
151 ></TT | |
152 ></TD | |
153 ><TD | |
154 ALIGN="LEFT" | |
155 VALIGN="TOP" | |
156 ><A | |
157 HREF="sdlactiveevent.html" | |
158 >Activation event</A | |
159 ></TD | |
160 ></TR | |
161 ><TR | |
162 ><TD | |
163 ALIGN="LEFT" | |
164 VALIGN="TOP" | |
165 ><TT | |
166 CLASS="STRUCTFIELD" | |
167 ><I | |
168 >key</I | |
169 ></TT | |
170 ></TD | |
171 ><TD | |
172 ALIGN="LEFT" | |
173 VALIGN="TOP" | |
174 ><A | |
175 HREF="sdlkeyboardevent.html" | |
176 >Keyboard event</A | |
177 ></TD | |
178 ></TR | |
179 ><TR | |
180 ><TD | |
181 ALIGN="LEFT" | |
182 VALIGN="TOP" | |
183 ><TT | |
184 CLASS="STRUCTFIELD" | |
185 ><I | |
186 >motion</I | |
187 ></TT | |
188 ></TD | |
189 ><TD | |
190 ALIGN="LEFT" | |
191 VALIGN="TOP" | |
192 ><A | |
193 HREF="sdlmousemotionevent.html" | |
194 >Mouse motion event</A | |
195 ></TD | |
196 ></TR | |
197 ><TR | |
198 ><TD | |
199 ALIGN="LEFT" | |
200 VALIGN="TOP" | |
201 ><TT | |
202 CLASS="STRUCTFIELD" | |
203 ><I | |
204 >button</I | |
205 ></TT | |
206 ></TD | |
207 ><TD | |
208 ALIGN="LEFT" | |
209 VALIGN="TOP" | |
210 ><A | |
211 HREF="sdlmousebuttonevent.html" | |
212 >Mouse button event</A | |
213 ></TD | |
214 ></TR | |
215 ><TR | |
216 ><TD | |
217 ALIGN="LEFT" | |
218 VALIGN="TOP" | |
219 ><TT | |
220 CLASS="STRUCTFIELD" | |
221 ><I | |
222 >jaxis</I | |
223 ></TT | |
224 ></TD | |
225 ><TD | |
226 ALIGN="LEFT" | |
227 VALIGN="TOP" | |
228 ><A | |
229 HREF="sdljoyaxisevent.html" | |
230 >Joystick axis motion event</A | |
231 ></TD | |
232 ></TR | |
233 ><TR | |
234 ><TD | |
235 ALIGN="LEFT" | |
236 VALIGN="TOP" | |
237 ><TT | |
238 CLASS="STRUCTFIELD" | |
239 ><I | |
240 >jball</I | |
241 ></TT | |
242 ></TD | |
243 ><TD | |
244 ALIGN="LEFT" | |
245 VALIGN="TOP" | |
246 ><A | |
247 HREF="sdljoyballevent.html" | |
248 >Joystick trackball motion event</A | |
249 ></TD | |
250 ></TR | |
251 ><TR | |
252 ><TD | |
253 ALIGN="LEFT" | |
254 VALIGN="TOP" | |
255 ><TT | |
256 CLASS="STRUCTFIELD" | |
257 ><I | |
258 >jhat</I | |
259 ></TT | |
260 ></TD | |
261 ><TD | |
262 ALIGN="LEFT" | |
263 VALIGN="TOP" | |
264 ><A | |
265 HREF="sdljoyhatevent.html" | |
266 >Joystick hat motion event</A | |
267 ></TD | |
268 ></TR | |
269 ><TR | |
270 ><TD | |
271 ALIGN="LEFT" | |
272 VALIGN="TOP" | |
273 ><TT | |
274 CLASS="STRUCTFIELD" | |
275 ><I | |
276 >jbutton</I | |
277 ></TT | |
278 ></TD | |
279 ><TD | |
280 ALIGN="LEFT" | |
281 VALIGN="TOP" | |
282 ><A | |
283 HREF="sdljoybuttonevent.html" | |
284 >Joystick button event</A | |
285 ></TD | |
286 ></TR | |
287 ><TR | |
288 ><TD | |
289 ALIGN="LEFT" | |
290 VALIGN="TOP" | |
291 ><TT | |
292 CLASS="STRUCTFIELD" | |
293 ><I | |
294 >resize</I | |
295 ></TT | |
296 ></TD | |
297 ><TD | |
298 ALIGN="LEFT" | |
299 VALIGN="TOP" | |
300 ><A | |
301 HREF="sdlresizeevent.html" | |
302 >Application window resize event</A | |
303 ></TD | |
304 ></TR | |
305 ><TR | |
306 ><TD | |
307 ALIGN="LEFT" | |
308 VALIGN="TOP" | |
309 ><TT | |
310 CLASS="STRUCTFIELD" | |
311 ><I | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
312 >expose</I |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
313 ></TT |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
314 ></TD |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
315 ><TD |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
316 ALIGN="LEFT" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
317 VALIGN="TOP" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
318 ><A |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
319 HREF="sdlexposeevent.html" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
320 >Application window expose event</A |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
321 ></TD |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
322 ></TR |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
323 ><TR |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
324 ><TD |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
325 ALIGN="LEFT" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
326 VALIGN="TOP" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
327 ><TT |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
328 CLASS="STRUCTFIELD" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
329 ><I |
0 | 330 >quit</I |
331 ></TT | |
332 ></TD | |
333 ><TD | |
334 ALIGN="LEFT" | |
335 VALIGN="TOP" | |
336 ><A | |
337 HREF="sdlquitevent.html" | |
338 >Application quit request event</A | |
339 ></TD | |
340 ></TR | |
341 ><TR | |
342 ><TD | |
343 ALIGN="LEFT" | |
344 VALIGN="TOP" | |
345 ><TT | |
346 CLASS="STRUCTFIELD" | |
347 ><I | |
348 >user</I | |
349 ></TT | |
350 ></TD | |
351 ><TD | |
352 ALIGN="LEFT" | |
353 VALIGN="TOP" | |
354 ><A | |
355 HREF="sdluserevent.html" | |
356 >User defined event</A | |
357 ></TD | |
358 ></TR | |
359 ><TR | |
360 ><TD | |
361 ALIGN="LEFT" | |
362 VALIGN="TOP" | |
363 ><TT | |
364 CLASS="STRUCTFIELD" | |
365 ><I | |
366 >syswm</I | |
367 ></TT | |
368 ></TD | |
369 ><TD | |
370 ALIGN="LEFT" | |
371 VALIGN="TOP" | |
372 ><A | |
373 HREF="sdlsyswmevent.html" | |
374 >Undefined window manager event</A | |
375 ></TD | |
376 ></TR | |
377 ></TBODY | |
378 ></TABLE | |
379 ><P | |
380 ></P | |
381 ></DIV | |
382 ></DIV | |
383 ><DIV | |
384 CLASS="REFSECT1" | |
385 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
386 NAME="AEN3791" |
0 | 387 ></A |
388 ><H2 | |
389 >Description</H2 | |
390 ><P | |
391 >The <SPAN | |
392 CLASS="STRUCTNAME" | |
393 >SDL_Event</SPAN | |
394 > union is the core to all event handling is SDL, its probably the most important structure after <SPAN | |
395 CLASS="STRUCTNAME" | |
396 >SDL_Surface</SPAN | |
397 >. <SPAN | |
398 CLASS="STRUCTNAME" | |
399 >SDL_Event</SPAN | |
400 > is a union of all event structures used in SDL, using it is a simple matter of knowing which union member relates to which event <TT | |
401 CLASS="STRUCTFIELD" | |
402 ><I | |
403 >type</I | |
404 ></TT | |
405 >.</P | |
406 ><P | |
407 ><DIV | |
408 CLASS="INFORMALTABLE" | |
409 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
410 NAME="AEN3799" |
0 | 411 ></A |
412 ><P | |
413 ></P | |
414 ><TABLE | |
415 BORDER="1" | |
416 CLASS="CALSTABLE" | |
417 ><THEAD | |
418 ><TR | |
419 ><TH | |
420 ALIGN="LEFT" | |
421 VALIGN="TOP" | |
422 >Event <TT | |
423 CLASS="STRUCTFIELD" | |
424 ><I | |
425 >type</I | |
426 ></TT | |
427 ></TH | |
428 ><TH | |
429 ALIGN="LEFT" | |
430 VALIGN="TOP" | |
431 >Event Structure</TH | |
432 ></TR | |
433 ></THEAD | |
434 ><TBODY | |
435 ><TR | |
436 ><TD | |
437 ALIGN="LEFT" | |
438 VALIGN="MIDDLE" | |
439 ><TT | |
440 CLASS="LITERAL" | |
441 >SDL_ACTIVEEVENT</TT | |
442 ></TD | |
443 ><TD | |
444 ALIGN="LEFT" | |
445 VALIGN="MIDDLE" | |
446 ><A | |
447 HREF="sdlactiveevent.html" | |
448 ><SPAN | |
449 CLASS="STRUCTNAME" | |
450 >SDL_ActiveEvent</SPAN | |
451 ></A | |
452 ></TD | |
453 ></TR | |
454 ><TR | |
455 ><TD | |
456 ALIGN="LEFT" | |
457 VALIGN="TOP" | |
458 ><TT | |
459 CLASS="LITERAL" | |
460 >SDL_KEYDOWN/UP</TT | |
461 ></TD | |
462 ><TD | |
463 ALIGN="LEFT" | |
464 VALIGN="TOP" | |
465 ><A | |
466 HREF="sdlkeyboardevent.html" | |
467 ><SPAN | |
468 CLASS="STRUCTNAME" | |
469 >SDL_KeyboardEvent</SPAN | |
470 ></A | |
471 ></TD | |
472 ></TR | |
473 ><TR | |
474 ><TD | |
475 ALIGN="LEFT" | |
476 VALIGN="TOP" | |
477 ><TT | |
478 CLASS="LITERAL" | |
479 >SDL_MOUSEMOTION</TT | |
480 ></TD | |
481 ><TD | |
482 ALIGN="LEFT" | |
483 VALIGN="TOP" | |
484 ><A | |
485 HREF="sdlmousemotionevent.html" | |
486 ><SPAN | |
487 CLASS="STRUCTNAME" | |
488 >SDL_MouseMotionEvent</SPAN | |
489 ></A | |
490 ></TD | |
491 ></TR | |
492 ><TR | |
493 ><TD | |
494 ALIGN="LEFT" | |
495 VALIGN="TOP" | |
496 ><TT | |
497 CLASS="LITERAL" | |
498 >SDL_MOUSEBUTTONDOWN/UP</TT | |
499 ></TD | |
500 ><TD | |
501 ALIGN="LEFT" | |
502 VALIGN="TOP" | |
503 ><A | |
504 HREF="sdlmousebuttonevent.html" | |
505 ><SPAN | |
506 CLASS="STRUCTNAME" | |
507 >SDL_MouseButtonEvent</SPAN | |
508 ></A | |
509 ></TD | |
510 ></TR | |
511 ><TR | |
512 ><TD | |
513 ALIGN="LEFT" | |
514 VALIGN="TOP" | |
515 ><TT | |
516 CLASS="LITERAL" | |
517 >SDL_JOYAXISMOTION</TT | |
518 ></TD | |
519 ><TD | |
520 ALIGN="LEFT" | |
521 VALIGN="TOP" | |
522 ><A | |
523 HREF="sdljoyaxisevent.html" | |
524 ><SPAN | |
525 CLASS="STRUCTNAME" | |
526 >SDL_JoyAxisEvent</SPAN | |
527 ></A | |
528 ></TD | |
529 ></TR | |
530 ><TR | |
531 ><TD | |
532 ALIGN="LEFT" | |
533 VALIGN="TOP" | |
534 ><TT | |
535 CLASS="LITERAL" | |
536 >SDL_JOYBALLMOTION</TT | |
537 ></TD | |
538 ><TD | |
539 ALIGN="LEFT" | |
540 VALIGN="TOP" | |
541 ><A | |
542 HREF="sdljoyballevent.html" | |
543 ><SPAN | |
544 CLASS="STRUCTNAME" | |
545 >SDL_JoyBallEvent</SPAN | |
546 ></A | |
547 ></TD | |
548 ></TR | |
549 ><TR | |
550 ><TD | |
551 ALIGN="LEFT" | |
552 VALIGN="TOP" | |
553 ><TT | |
554 CLASS="LITERAL" | |
555 >SDL_JOYHATMOTION</TT | |
556 ></TD | |
557 ><TD | |
558 ALIGN="LEFT" | |
559 VALIGN="TOP" | |
560 ><A | |
561 HREF="sdljoyhatevent.html" | |
562 ><SPAN | |
563 CLASS="STRUCTNAME" | |
564 >SDL_JoyHatEvent</SPAN | |
565 ></A | |
566 ></TD | |
567 ></TR | |
568 ><TR | |
569 ><TD | |
570 ALIGN="LEFT" | |
571 VALIGN="TOP" | |
572 ><TT | |
573 CLASS="LITERAL" | |
574 >SDL_JOYBUTTONDOWN/UP</TT | |
575 ></TD | |
576 ><TD | |
577 ALIGN="LEFT" | |
578 VALIGN="TOP" | |
579 ><A | |
580 HREF="sdljoybuttonevent.html" | |
581 ><SPAN | |
582 CLASS="STRUCTNAME" | |
583 >SDL_JoyButtonEvent</SPAN | |
584 ></A | |
585 ></TD | |
586 ></TR | |
587 ><TR | |
588 ><TD | |
589 ALIGN="LEFT" | |
590 VALIGN="TOP" | |
591 ><TT | |
592 CLASS="LITERAL" | |
593 >SDL_QUIT</TT | |
594 ></TD | |
595 ><TD | |
596 ALIGN="LEFT" | |
597 VALIGN="TOP" | |
598 ><A | |
599 HREF="sdlquitevent.html" | |
600 ><SPAN | |
601 CLASS="STRUCTNAME" | |
602 >SDL_QuitEvent</SPAN | |
603 ></A | |
604 ></TD | |
605 ></TR | |
606 ><TR | |
607 ><TD | |
608 ALIGN="LEFT" | |
609 VALIGN="TOP" | |
610 ><TT | |
611 CLASS="LITERAL" | |
612 >SDL_SYSWMEVENT</TT | |
613 ></TD | |
614 ><TD | |
615 ALIGN="LEFT" | |
616 VALIGN="TOP" | |
617 ><A | |
618 HREF="sdlsyswmevent.html" | |
619 ><SPAN | |
620 CLASS="STRUCTNAME" | |
621 >SDL_SysWMEvent</SPAN | |
622 ></A | |
623 ></TD | |
624 ></TR | |
625 ><TR | |
626 ><TD | |
627 ALIGN="LEFT" | |
628 VALIGN="TOP" | |
629 ><TT | |
630 CLASS="LITERAL" | |
631 >SDL_VIDEORESIZE</TT | |
632 ></TD | |
633 ><TD | |
634 ALIGN="LEFT" | |
635 VALIGN="TOP" | |
636 ><A | |
637 HREF="sdlresizeevent.html" | |
638 ><SPAN | |
639 CLASS="STRUCTNAME" | |
640 >SDL_ResizeEvent</SPAN | |
641 ></A | |
642 ></TD | |
643 ></TR | |
644 ><TR | |
645 ><TD | |
646 ALIGN="LEFT" | |
647 VALIGN="TOP" | |
648 ><TT | |
649 CLASS="LITERAL" | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
650 >SDL_VIDEOEXPOSE</TT |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
651 ></TD |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
652 ><TD |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
653 ALIGN="LEFT" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
654 VALIGN="TOP" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
655 ><A |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
656 HREF="sdlexposeevent.html" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
657 ><SPAN |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
658 CLASS="STRUCTNAME" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
659 >SDL_ExposeEvent</SPAN |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
660 ></A |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
661 ></TD |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
662 ></TR |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
663 ><TR |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
664 ><TD |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
665 ALIGN="LEFT" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
666 VALIGN="TOP" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
667 ><TT |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
668 CLASS="LITERAL" |
0 | 669 >SDL_USEREVENT</TT |
670 ></TD | |
671 ><TD | |
672 ALIGN="LEFT" | |
673 VALIGN="TOP" | |
674 ><A | |
675 HREF="sdluserevent.html" | |
676 ><SPAN | |
677 CLASS="STRUCTNAME" | |
678 >SDL_UserEvent</SPAN | |
679 ></A | |
680 ></TD | |
681 ></TR | |
682 ></TBODY | |
683 ></TABLE | |
684 ><P | |
685 ></P | |
686 ></DIV | |
687 ></P | |
688 ></DIV | |
689 ><DIV | |
690 CLASS="REFSECT1" | |
691 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
692 NAME="AEN3885" |
0 | 693 ></A |
694 ><H2 | |
695 >Use</H2 | |
696 ><P | |
697 >The <SPAN | |
698 CLASS="STRUCTNAME" | |
699 >SDL_Event</SPAN | |
700 > structure has two uses</P | |
701 ><P | |
702 ></P | |
703 ><UL | |
704 COMPACT="COMPACT" | |
705 ><LI | |
706 ><P | |
707 >Reading events on the event queue</P | |
708 ></LI | |
709 ><LI | |
710 ><P | |
711 >Placing events on the event queue</P | |
712 ></LI | |
713 ></UL | |
714 ><P | |
715 >Reading events from the event queue is done with either <A | |
716 HREF="sdlpollevent.html" | |
717 ><TT | |
718 CLASS="FUNCTION" | |
719 >SDL_PollEvent</TT | |
720 ></A | |
721 > or <A | |
722 HREF="sdlpeepevents.html" | |
723 ><TT | |
724 CLASS="FUNCTION" | |
725 >SDL_PeepEvents</TT | |
726 ></A | |
727 >. We'll use <TT | |
728 CLASS="FUNCTION" | |
729 >SDL_PollEvent</TT | |
730 > and step through an example.</P | |
731 ><P | |
732 >First off, we create an empty <SPAN | |
733 CLASS="STRUCTNAME" | |
734 >SDL_Event</SPAN | |
735 > structure. | |
736 <PRE | |
737 CLASS="PROGRAMLISTING" | |
738 >SDL_Event test_event;</PRE | |
739 > | |
740 <TT | |
741 CLASS="FUNCTION" | |
742 >SDL_PollEvent</TT | |
743 > removes the next event from the event queue, if there are no events on the queue it returns <SPAN | |
744 CLASS="RETURNVALUE" | |
745 >0</SPAN | |
746 > otherwise it returns <SPAN | |
747 CLASS="RETURNVALUE" | |
748 >1</SPAN | |
749 >. We use a <TT | |
750 CLASS="FUNCTION" | |
751 >while</TT | |
752 > loop to process each event in turn. | |
753 <PRE | |
754 CLASS="PROGRAMLISTING" | |
755 >while(SDL_PollEvent(&test_event)) {</PRE | |
756 > | |
757 The <TT | |
758 CLASS="FUNCTION" | |
759 >SDL_PollEvent</TT | |
760 > function take a pointer to an <SPAN | |
761 CLASS="STRUCTNAME" | |
762 >SDL_Event</SPAN | |
763 > structure that is to be filled with event information. We know that if <TT | |
764 CLASS="FUNCTION" | |
765 >SDL_PollEvent</TT | |
766 > removes an event from the queue then the event information will be placed in our <SPAN | |
767 CLASS="STRUCTNAME" | |
768 >test_event</SPAN | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
769 > structure, but we also know that the <SPAN |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
770 CLASS="emphasis" |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
771 ><I |
0 | 772 CLASS="EMPHASIS" |
773 >type</I | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
774 ></SPAN |
0 | 775 > of event will be placed in the <TT |
776 CLASS="STRUCTFIELD" | |
777 ><I | |
778 >type</I | |
779 ></TT | |
780 > member of <SPAN | |
781 CLASS="STRUCTNAME" | |
782 >test_event</SPAN | |
783 >. So to handle each event <TT | |
784 CLASS="STRUCTFIELD" | |
785 ><I | |
786 >type</I | |
787 ></TT | |
788 > seperately we use a <TT | |
789 CLASS="FUNCTION" | |
790 >switch</TT | |
791 > statement. | |
792 <PRE | |
793 CLASS="PROGRAMLISTING" | |
794 > switch(test_event.type) {</PRE | |
795 > | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
796 We need to know what kind of events we're looking for <SPAN |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
797 CLASS="emphasis" |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
798 ><I |
0 | 799 CLASS="EMPHASIS" |
800 >and</I | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
801 ></SPAN |
0 | 802 > the event <TT |
803 CLASS="STRUCTFIELD" | |
804 ><I | |
805 >type</I | |
806 ></TT | |
807 >'s of those events. So lets assume we want to detect where the user is moving the mouse pointer within our application. We look through our event types and notice that <TT | |
808 CLASS="LITERAL" | |
809 >SDL_MOUSEMOTION</TT | |
810 > is, more than likely, the event we're looking for. A little <A | |
811 HREF="sdlmousemotionevent.html" | |
812 >more</A | |
813 > research tells use that <TT | |
814 CLASS="LITERAL" | |
815 >SDL_MOUSEMOTION</TT | |
816 > events are handled within the <A | |
817 HREF="sdlmousemotionevent.html" | |
818 ><SPAN | |
819 CLASS="STRUCTNAME" | |
820 >SDL_MouseMotionEvent</SPAN | |
821 ></A | |
822 > structure which is the <TT | |
823 CLASS="STRUCTFIELD" | |
824 ><I | |
825 >motion</I | |
826 ></TT | |
827 > member of <SPAN | |
828 CLASS="STRUCTNAME" | |
829 >SDL_Event</SPAN | |
830 >. We can check for the <TT | |
831 CLASS="LITERAL" | |
832 >SDL_MOUSEMOTION</TT | |
833 > event <TT | |
834 CLASS="STRUCTFIELD" | |
835 ><I | |
836 >type</I | |
837 ></TT | |
838 > within our <TT | |
839 CLASS="FUNCTION" | |
840 >switch</TT | |
841 > statement like so: | |
842 <PRE | |
843 CLASS="PROGRAMLISTING" | |
844 > case SDL_MOUSEMOTION:</PRE | |
845 > | |
846 All we need do now is read the information out of the <TT | |
847 CLASS="STRUCTFIELD" | |
848 ><I | |
849 >motion</I | |
850 ></TT | |
851 > member of <SPAN | |
852 CLASS="STRUCTNAME" | |
853 >test_event</SPAN | |
854 >. | |
855 <PRE | |
856 CLASS="PROGRAMLISTING" | |
857 > printf("We got a motion event.\n"); | |
858 printf("Current mouse position is: (%d, %d)\n", test_event.motion.x, test_event.motion.y); | |
859 break; | |
860 default: | |
861 printf("Unhandled Event!\n"); | |
862 break; | |
863 } | |
864 } | |
865 printf("Event queue empty.\n");</PRE | |
866 ></P | |
867 ><P | |
868 >It is also possible to push events onto the event queue and so use it as a two-way communication path. Both <A | |
869 HREF="sdlpushevent.html" | |
870 ><TT | |
871 CLASS="FUNCTION" | |
872 >SDL_PushEvent</TT | |
873 ></A | |
874 > and <A | |
875 HREF="sdlpeepevents.html" | |
876 ><TT | |
877 CLASS="FUNCTION" | |
878 >SDL_PeepEvents</TT | |
879 ></A | |
880 > allow you to place events onto the event queue. This is usually used to place a <TT | |
881 CLASS="LITERAL" | |
882 >SDL_USEREVENT</TT | |
883 > on the event queue, however you could use it to post fake input events if you wished. Creating your own events is a simple matter of choosing the event type you want, setting the <TT | |
884 CLASS="STRUCTFIELD" | |
885 ><I | |
886 >type</I | |
887 ></TT | |
888 > member and filling the appropriate member structure with information. | |
889 <PRE | |
890 CLASS="PROGRAMLISTING" | |
891 >SDL_Event user_event; | |
892 | |
893 user_event.type=SDL_USEREVENT; | |
894 user_event.user.code=2; | |
895 user_event.user.data1=NULL; | |
896 user_event.user.data2=NULL; | |
897 SDL_PushEvent(&user_event);</PRE | |
898 ></P | |
899 ></DIV | |
900 ><DIV | |
901 CLASS="REFSECT1" | |
902 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
903 NAME="AEN3942" |
0 | 904 ></A |
905 ><H2 | |
906 >See Also</H2 | |
907 ><P | |
908 ><A | |
909 HREF="sdlpollevent.html" | |
910 ><TT | |
911 CLASS="FUNCTION" | |
912 >SDL_PollEvent</TT | |
913 ></A | |
914 >, | |
915 <A | |
916 HREF="sdlpushevent.html" | |
917 ><TT | |
918 CLASS="FUNCTION" | |
919 >SDL_PushEvent</TT | |
920 ></A | |
921 >, | |
922 <A | |
923 HREF="sdlpeepevents.html" | |
924 ><TT | |
925 CLASS="FUNCTION" | |
926 >SDL_PeepEvents</TT | |
927 ></A | |
928 ></P | |
929 ></DIV | |
930 ><DIV | |
931 CLASS="NAVFOOTER" | |
932 ><HR | |
933 ALIGN="LEFT" | |
934 WIDTH="100%"><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
935 SUMMARY="Footer navigation table" |
0 | 936 WIDTH="100%" |
937 BORDER="0" | |
938 CELLPADDING="0" | |
939 CELLSPACING="0" | |
940 ><TR | |
941 ><TD | |
942 WIDTH="33%" | |
943 ALIGN="left" | |
944 VALIGN="top" | |
945 ><A | |
946 HREF="eventstructures.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
947 ACCESSKEY="P" |
0 | 948 >Prev</A |
949 ></TD | |
950 ><TD | |
951 WIDTH="34%" | |
952 ALIGN="center" | |
953 VALIGN="top" | |
954 ><A | |
955 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
956 ACCESSKEY="H" |
0 | 957 >Home</A |
958 ></TD | |
959 ><TD | |
960 WIDTH="33%" | |
961 ALIGN="right" | |
962 VALIGN="top" | |
963 ><A | |
964 HREF="sdlactiveevent.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
965 ACCESSKEY="N" |
0 | 966 >Next</A |
967 ></TD | |
968 ></TR | |
969 ><TR | |
970 ><TD | |
971 WIDTH="33%" | |
972 ALIGN="left" | |
973 VALIGN="top" | |
974 >SDL Event Structures.</TD | |
975 ><TD | |
976 WIDTH="34%" | |
977 ALIGN="center" | |
978 VALIGN="top" | |
979 ><A | |
980 HREF="eventstructures.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
981 ACCESSKEY="U" |
0 | 982 >Up</A |
983 ></TD | |
984 ><TD | |
985 WIDTH="33%" | |
986 ALIGN="right" | |
987 VALIGN="top" | |
988 >SDL_ActiveEvent</TD | |
989 ></TR | |
990 ></TABLE | |
991 ></DIV | |
992 ></BODY | |
993 ></HTML | |
2278
85cbe9c892f4
Merged revision 3455 from SDL 1.2, fixing documentation typo.
Sam Lantinga <slouken@libsdl.org>
parents:
803
diff
changeset
|
994 > |