Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5131 clevermous 1
2
>
3
>
4
>Events
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="SDL Reference"
14
HREF="reference.html">
15
REL="PREVIOUS"
16
TITLE="SDL_WM_GrabInput"
17
HREF="sdlwmgrabinput.html">
18
REL="NEXT"
19
TITLE="SDL Event Structures."
20
HREF="eventstructures.html">
21
NAME="KEYWORD"
22
CONTENT="events">
23
NAME="KEYWORD"
24
CONTENT="function">
25
>
26
CLASS="CHAPTER"
27
BGCOLOR="#FFF8DC"
28
TEXT="#000000"
29
LINK="#0000ee"
30
VLINK="#551a8b"
31
ALINK="#ff0000"
32
>
33
CLASS="NAVHEADER"
34
>
35
WIDTH="100%"
36
BORDER="0"
37
CELLPADDING="0"
38
CELLSPACING="0"
39
>
40
>
41
COLSPAN="3"
42
ALIGN="center"
43
>SDL Library Documentation
44
>
45
>
46
>
47
WIDTH="10%"
48
ALIGN="left"
49
VALIGN="bottom"
50
>
51
HREF="sdlwmgrabinput.html"
52
>Prev
53
>
54
>
55
WIDTH="80%"
56
ALIGN="center"
57
VALIGN="bottom"
58
>
59
>
60
WIDTH="10%"
61
ALIGN="right"
62
VALIGN="bottom"
63
>
64
HREF="eventstructures.html"
65
>Next
66
>
67
>
68
>
69
>
70
ALIGN="LEFT"
71
WIDTH="100%">
72
>
73
CLASS="CHAPTER"
74
>
75
>
76
NAME="EVENT"
77
>Chapter 8. Events
78
>
79
>
80
CLASS="TOC"
81
>
82
>
83
>
84
>Table of Contents
85
>
86
>
87
>
88
HREF="event.html#AEN3269"
89
>Introduction
90
>
91
>
92
>
93
HREF="eventstructures.html"
94
>SDL Event Structures.
95
>
96
>
97
>
98
HREF="eventfunctions.html"
99
>Event Functions.
100
>
101
>
102
>
103
>
104
CLASS="SECT1"
105
>
106
CLASS="SECT1"
107
>
108
NAME="AEN3269"
109
>Introduction
110
>
111
>
112
>Event handling allows your application to receive input from the user. Event handling is initalised (along with video) with a call to:
113
114
CLASS="PROGRAMLISTING"
115
>SDL_Init(SDL_INIT_VIDEO);
116
>
117
Interally, SDL stores all the events waiting to be handled in an event queue. Using functions like 
118
HREF="sdlpollevent.html"
119
>
120
CLASS="FUNCTION"
121
>SDL_PollEvent
122
>
123
> and 
124
HREF="sdlpeepevents.html"
125
>
126
CLASS="FUNCTION"
127
>SDL_PeepEvents
128
>
129
> you can observe and handle waiting input events.
130
>
131
>The key to event handling in SDL is the 
132
HREF="sdlevent.html"
133
>
134
CLASS="STRUCTNAME"
135
>SDL_Event
136
>
137
> union. The event queue itself is composed of a series of 
138
CLASS="STRUCTNAME"
139
>SDL_Event
140
> unions, one for each waiting event. 
141
CLASS="STRUCTNAME"
142
>SDL_Event
143
> unions are read from the queue with the 
144
CLASS="FUNCTION"
145
>SDL_PollEvent
146
> function and it is then up to the application to process the information stored with them.
147
>
148
>
149
>
150
CLASS="NAVFOOTER"
151
>
152
ALIGN="LEFT"
153
WIDTH="100%">
154
WIDTH="100%"
155
BORDER="0"
156
CELLPADDING="0"
157
CELLSPACING="0"
158
>
159
>
160
WIDTH="33%"
161
ALIGN="left"
162
VALIGN="top"
163
>
164
HREF="sdlwmgrabinput.html"
165
>Prev
166
>
167
>
168
WIDTH="34%"
169
ALIGN="center"
170
VALIGN="top"
171
>
172
HREF="index.html"
173
>Home
174
>
175
>
176
WIDTH="33%"
177
ALIGN="right"
178
VALIGN="top"
179
>
180
HREF="eventstructures.html"
181
>Next
182
>
183
>
184
>
185
>
186
WIDTH="33%"
187
ALIGN="left"
188
VALIGN="top"
189
>SDL_WM_GrabInput
190
>
191
WIDTH="34%"
192
ALIGN="center"
193
VALIGN="top"
194
>
195
HREF="reference.html"
196
>Up
197
>
198
>
199
WIDTH="33%"
200
ALIGN="right"
201
VALIGN="top"
202
>SDL Event Structures.
203
>
204
>
205
>
206
>
207
>
208
>