Mercurial > sdl-ios-xcode
annotate docs/html/guideinput.html @ 1588:e20dcef5647c
Improved DirectFB install detection
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 22 Mar 2006 09:18:10 +0000 |
parents | 355632dca928 |
children |
rev | line source |
---|---|
0 | 1 <HTML |
2 ><HEAD | |
3 ><TITLE | |
4 >Input handling</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 Guide" | |
14 HREF="guide.html"><LINK | |
15 REL="PREVIOUS" | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
16 TITLE="Using OpenGL With SDL" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
17 HREF="guidevideoopengl.html"><LINK |
0 | 18 REL="NEXT" |
19 TITLE="Handling the Keyboard" | |
20 HREF="guideinputkeyboard.html"></HEAD | |
21 ><BODY | |
22 CLASS="CHAPTER" | |
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 | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
48 HREF="guidevideoopengl.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="guideinputkeyboard.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 ><DIV | |
72 CLASS="CHAPTER" | |
73 ><H1 | |
74 ><A | |
75 NAME="GUIDEINPUT" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
76 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
77 >Chapter 3. Input handling</H1 |
0 | 78 ><DIV |
79 CLASS="TOC" | |
80 ><DL | |
81 ><DT | |
82 ><B | |
83 >Table of Contents</B | |
84 ></DT | |
85 ><DT | |
86 ><A | |
87 HREF="guideinput.html#GUIDEINPUTJOYSTICK" | |
88 >Handling Joysticks</A | |
89 ></DT | |
90 ><DT | |
91 ><A | |
92 HREF="guideinputkeyboard.html" | |
93 >Handling the Keyboard</A | |
94 ></DT | |
95 ></DL | |
96 ></DIV | |
97 ><DIV | |
98 CLASS="SECT1" | |
99 ><H1 | |
100 CLASS="SECT1" | |
101 ><A | |
102 NAME="GUIDEINPUTJOYSTICK" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
103 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
104 >Handling Joysticks</H1 |
0 | 105 ><DIV |
106 CLASS="SECT2" | |
107 ><H2 | |
108 CLASS="SECT2" | |
109 ><A | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
110 NAME="AEN135" |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
111 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
112 >Initialization</H2 |
0 | 113 ><P |
114 >The first step in using a joystick in a SDL program is to initialize the Joystick subsystems of SDL. This done by passing the <TT | |
115 CLASS="LITERAL" | |
116 >SDL_INIT_JOYSTICK</TT | |
117 > flag to <A | |
118 HREF="sdlinit.html" | |
119 ><TT | |
120 CLASS="FUNCTION" | |
121 >SDL_Init</TT | |
122 ></A | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
123 >. The joystick flag will usually be used in conjunction with other flags (like the video flag) because the joystick is usually used to control something.</P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
124 ><DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
125 CLASS="EXAMPLE" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
126 ><A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
127 NAME="AEN141" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
128 ></A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
129 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
130 ><B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
131 >Example 3-1. Initializing SDL with Joystick Support</B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
132 ></P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
133 ><PRE |
0 | 134 CLASS="PROGRAMLISTING" |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
135 > if (SDL_Init( SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) < 0) |
0 | 136 { |
137 fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); | |
138 exit(1); | |
139 }</PRE | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
140 ></DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
141 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
142 >This will attempt to start SDL with both the video and the joystick subsystems activated.</P |
0 | 143 ></DIV |
144 ><DIV | |
145 CLASS="SECT2" | |
146 ><H2 | |
147 CLASS="SECT2" | |
148 ><A | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
149 NAME="AEN145" |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
150 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
151 >Querying</H2 |
0 | 152 ><P |
153 >If we have reached this point then we can safely assume that the SDL library has been initialized and that the Joystick subsystem is active. We can now call some video and/or sound functions to get things going before we need the joystick. Eventually we have to make sure that there is actually a joystick to work with. It's wise to always check even if you know a joystick will be present on the system because it can also help detect when the joystick is unplugged. The function used to check for joysticks is <A | |
154 HREF="sdlnumjoysticks.html" | |
155 ><TT | |
156 CLASS="FUNCTION" | |
157 >SDL_NumJoysticks</TT | |
158 ></A | |
159 >.</P | |
160 ><P | |
161 >This function simply returns the number of joysticks available on the system. If it is at least one then we are in good shape. The next step is to determine which joystick the user wants to use. If the number of joysticks available is only one then it is safe to assume that one joystick is the one the user wants to use. SDL has a function to get the name of the joysticks as assigned by the operations system and that function is <A | |
162 HREF="sdljoystickname.html" | |
163 ><TT | |
164 CLASS="FUNCTION" | |
165 >SDL_JoystickName</TT | |
166 ></A | |
167 >. The joystick is specified by an index where 0 is the first joystick and the last joystick is the number returned by <TT | |
168 CLASS="FUNCTION" | |
169 >SDL_NumJoysticks</TT | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
170 > - 1. In the demonstration a list of all available joysticks is printed to stdout.</P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
171 ><DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
172 CLASS="EXAMPLE" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
173 ><A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
174 NAME="AEN154" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
175 ></A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
176 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
177 ><B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
178 >Example 3-2. Querying the Number of Available Joysticks</B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
179 ></P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
180 ><PRE |
0 | 181 CLASS="PROGRAMLISTING" |
182 > printf("%i joysticks were found.\n\n", SDL_NumJoysticks() ); | |
183 printf("The names of the joysticks are:\n"); | |
184 | |
185 for( i=0; i < SDL_NumJoysticks(); i++ ) | |
186 { | |
187 printf(" %s\n", SDL_JoystickName(i)); | |
188 }</PRE | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
189 ></DIV |
0 | 190 ></DIV |
191 ><DIV | |
192 CLASS="SECT2" | |
193 ><H2 | |
194 CLASS="SECT2" | |
195 ><A | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
196 NAME="AEN157" |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
197 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
198 >Opening a Joystick and Receiving Joystick Events</H2 |
0 | 199 ><P |
200 >SDL's event driven architecture makes working with joysticks a snap. Joysticks can trigger 4 different types of events: | |
201 <P | |
202 ></P | |
203 ><TABLE | |
204 BORDER="0" | |
205 ><TBODY | |
206 ><TR | |
207 ><TD | |
208 ><A | |
209 HREF="sdljoyaxisevent.html" | |
210 ><SPAN | |
211 CLASS="STRUCTNAME" | |
212 >SDL_JoyAxisEvent</SPAN | |
213 ></A | |
214 ></TD | |
215 ><TD | |
216 >Occurs when an axis changes</TD | |
217 ></TR | |
218 ><TR | |
219 ><TD | |
220 ><A | |
221 HREF="sdljoyballevent.html" | |
222 ><SPAN | |
223 CLASS="STRUCTNAME" | |
224 >SDL_JoyBallEvent</SPAN | |
225 ></A | |
226 ></TD | |
227 ><TD | |
228 >Occurs when a joystick trackball's position changes</TD | |
229 ></TR | |
230 ><TR | |
231 ><TD | |
232 ><A | |
233 HREF="sdljoyhatevent.html" | |
234 ><SPAN | |
235 CLASS="STRUCTNAME" | |
236 >SDL_JoyHatEvent</SPAN | |
237 ></A | |
238 ></TD | |
239 ><TD | |
240 >Occurs when a hat's position changes</TD | |
241 ></TR | |
242 ><TR | |
243 ><TD | |
244 ><A | |
245 HREF="sdljoybuttonevent.html" | |
246 ><SPAN | |
247 CLASS="STRUCTNAME" | |
248 >SDL_JoyButtonEvent</SPAN | |
249 ></A | |
250 ></TD | |
251 ><TD | |
252 >Occurs when a button is pressed or released</TD | |
253 ></TR | |
254 ></TBODY | |
255 ></TABLE | |
256 ><P | |
257 ></P | |
258 ></P | |
259 ><P | |
260 >Events are received from all joysticks opened. The first thing that needs to be done in order to receive joystick events is to call <A | |
261 HREF="sdljoystickeventstate.html" | |
262 ><TT | |
263 CLASS="FUNCTION" | |
264 >SDL_JoystickEventState</TT | |
265 ></A | |
266 > with the <TT | |
267 CLASS="LITERAL" | |
268 >SDL_ENABLE</TT | |
269 > flag. Next you must open the joysticks that you want to receive envents from. This is done with the <A | |
270 HREF="sdljoystickopen.html" | |
271 ><TT | |
272 CLASS="FUNCTION" | |
273 >SDL_JoystickOpen</TT | |
274 ></A | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
275 > function. For the example we are only interested in events from the first joystick on the system, regardless of what it may be. To receive events from it we would do this:</P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
276 ><DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
277 CLASS="EXAMPLE" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
278 ><A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
279 NAME="AEN183" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
280 ></A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
281 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
282 ><B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
283 >Example 3-3. Opening a Joystick</B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
284 ></P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
285 ><PRE |
0 | 286 CLASS="PROGRAMLISTING" |
287 > SDL_Joystick *joystick; | |
288 | |
289 SDL_JoystickEventState(SDL_ENABLE); | |
290 joystick = SDL_JoystickOpen(0);</PRE | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
291 ></DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
292 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
293 >If we wanted to receive events for other joysticks we would open them with calls to <TT |
0 | 294 CLASS="FUNCTION" |
295 >SDL_JoystickOpen</TT | |
296 > just like we opened joystick 0, except we would store the <SPAN | |
297 CLASS="STRUCTNAME" | |
298 >SDL_Joystick</SPAN | |
299 > structure they return in a different pointer. We only need the joystick pointer when we are querying the joysticks or when we are closing the joystick.</P | |
300 ><P | |
301 >Up to this point all the code we have is used just to initialize the joysticks in order to read values at run time. All we need now is an event loop, which is something that all SDL programs should have anyway to receive the systems quit events. We must now add code to check the event loop for at least some of the above mentioned events. Let's assume our event loop looks like this: | |
302 <PRE | |
303 CLASS="PROGRAMLISTING" | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
304 > SDL_Event event; |
0 | 305 /* Other initializtion code goes here */ |
306 | |
307 /* Start main game loop here */ | |
308 | |
309 while(SDL_PollEvent(&event)) | |
310 { | |
311 switch(event.type) | |
312 { | |
313 case SDL_KEYDOWN: | |
314 /* handle keyboard stuff here */ | |
315 break; | |
316 | |
317 case SDL_QUIT: | |
318 /* Set whatever flags are necessary to */ | |
319 /* end the main game loop here */ | |
320 break; | |
321 } | |
322 } | |
323 | |
324 /* End loop here */</PRE | |
325 > | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
326 To handle Joystick events we merely add cases for them, first we'll add axis handling code. Axis checks can get kinda of tricky because alot of the joystick events received are junk. Joystick axis have a tendency to vary just a little between polling due to the way they are designed. To compensate for this you have to set a threshold for changes and ignore the events that have'nt exceeded the threshold. 10% is usually a good threshold value. This sounds a lot more complicated than it is. Here is the Axis event handler:</P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
327 ><DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
328 CLASS="EXAMPLE" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
329 ><A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
330 NAME="AEN191" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
331 ></A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
332 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
333 ><B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
334 >Example 3-4. Joystick Axis Events</B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
335 ></P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
336 ><PRE |
0 | 337 CLASS="PROGRAMLISTING" |
338 > case SDL_JOYAXISMOTION: /* Handle Joystick Motion */ | |
339 if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) ) | |
340 { | |
341 /* code goes here */ | |
342 } | |
343 break;</PRE | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
344 ></DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
345 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
346 >Another trick with axis events is that up-down and left-right movement are two different sets of axes. The most important axis is axis 0 (left-right) and axis 1 (up-down). To handle them seperatly in the code we do the following:</P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
347 ><DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
348 CLASS="EXAMPLE" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
349 ><A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
350 NAME="AEN195" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
351 ></A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
352 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
353 ><B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
354 >Example 3-5. More Joystick Axis Events</B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
355 ></P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
356 ><PRE |
0 | 357 CLASS="PROGRAMLISTING" |
358 > case SDL_JOYAXISMOTION: /* Handle Joystick Motion */ | |
359 if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) ) | |
360 { | |
361 if( event.jaxis.axis == 0) | |
362 { | |
363 /* Left-right movement code goes here */ | |
364 } | |
365 | |
366 if( event.jaxis.axis == 1) | |
367 { | |
368 /* Up-Down movement code goes here */ | |
369 } | |
370 } | |
371 break;</PRE | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
372 ></DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
373 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
374 >Ideally the code here should use <TT |
0 | 375 CLASS="STRUCTFIELD" |
376 ><I | |
377 >event.jaxis.value</I | |
378 ></TT | |
379 > to scale something. For example lets assume you are using the joystick to control the movement of a spaceship. If the user is using an analog joystick and they push the stick a little bit they expect to move less than if they pushed it a lot. Designing your code for this situation is preferred because it makes the experience for users of analog controls better and remains the same for users of digital controls.</P | |
380 ><P | |
381 >If your joystick has any additional axis then they may be used for other sticks or throttle controls and those axis return values too just with different <TT | |
382 CLASS="STRUCTFIELD" | |
383 ><I | |
384 >event.jaxis.axis</I | |
385 ></TT | |
386 > values.</P | |
387 ><P | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
388 >Button handling is simple compared to the axis checking.</P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
389 ><DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
390 CLASS="EXAMPLE" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
391 ><A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
392 NAME="AEN203" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
393 ></A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
394 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
395 ><B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
396 >Example 3-6. Joystick Button Events</B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
397 ></P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
398 ><PRE |
0 | 399 CLASS="PROGRAMLISTING" |
400 > case SDL_JOYBUTTONDOWN: /* Handle Joystick Button Presses */ | |
401 if ( event.jbutton.button == 0 ) | |
402 { | |
403 /* code goes here */ | |
404 } | |
405 break;</PRE | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
406 ></DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
407 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
408 >Button checks are simpler than axis checks because a button can only be pressed or not pressed. The <TT |
0 | 409 CLASS="LITERAL" |
410 >SDL_JOYBUTTONDOWN</TT | |
411 > event is triggered when a button is pressed and the <TT | |
412 CLASS="LITERAL" | |
413 >SDL_JOYBUTTONUP</TT | |
414 > event is fired when a button is released. We do have to know what button was pressed though, that is done by reading the <TT | |
415 CLASS="STRUCTFIELD" | |
416 ><I | |
417 >event.jbutton.button</I | |
418 ></TT | |
419 > field.</P | |
420 ><P | |
421 >Lastly when we are through using our joysticks we should close them with a call to <A | |
422 HREF="sdljoystickclose.html" | |
423 ><TT | |
424 CLASS="FUNCTION" | |
425 >SDL_JoystickClose</TT | |
426 ></A | |
427 >. To close our opened joystick 0 we would do this at the end of our program: | |
428 <PRE | |
429 CLASS="PROGRAMLISTING" | |
430 > SDL_JoystickClose(joystick);</PRE | |
431 ></P | |
432 ></DIV | |
433 ><DIV | |
434 CLASS="SECT2" | |
435 ><H2 | |
436 CLASS="SECT2" | |
437 ><A | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
438 NAME="AEN214" |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
439 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
440 >Advanced Joystick Functions</H2 |
0 | 441 ><P |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
442 >That takes care of the controls that you can count on being on every joystick under the sun, but there are a few extra things that SDL can support. Joyballs are next on our list, they are alot like axis with a few minor differences. Joyballs store relative changes unlike the the absolute postion stored in a axis event. Also one trackball event contains both the change in x and they change in y. Our case for it is as follows:</P |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
443 ><DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
444 CLASS="EXAMPLE" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
445 ><A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
446 NAME="AEN217" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
447 ></A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
448 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
449 ><B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
450 >Example 3-7. Joystick Ball Events</B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
451 ></P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
452 ><PRE |
0 | 453 CLASS="PROGRAMLISTING" |
454 > case SDL_JOYBALLMOTION: /* Handle Joyball Motion */ | |
455 if( event.jball.ball == 0 ) | |
456 { | |
457 /* ball handling */ | |
458 } | |
459 break;</PRE | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
460 ></DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
461 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
462 >The above checks the first joyball on the joystick. The change in position will be stored in <TT |
0 | 463 CLASS="STRUCTFIELD" |
464 ><I | |
465 >event.jball.xrel</I | |
466 ></TT | |
467 > and <TT | |
468 CLASS="STRUCTFIELD" | |
469 ><I | |
470 >event.jball.yrel</I | |
471 ></TT | |
472 >.</P | |
473 ><P | |
474 >Finally we have the hat event. Hats report only the direction they are pushed in. We check hat's position with the bitmasks: | |
475 | |
476 <P | |
477 ></P | |
478 ><TABLE | |
479 BORDER="0" | |
480 ><TBODY | |
481 ><TR | |
482 ><TD | |
483 ><TT | |
484 CLASS="LITERAL" | |
485 >SDL_HAT_CENTERED</TT | |
486 ></TD | |
487 ></TR | |
488 ><TR | |
489 ><TD | |
490 ><TT | |
491 CLASS="LITERAL" | |
492 >SDL_HAT_UP</TT | |
493 ></TD | |
494 ></TR | |
495 ><TR | |
496 ><TD | |
497 ><TT | |
498 CLASS="LITERAL" | |
499 >SDL_HAT_RIGHT</TT | |
500 ></TD | |
501 ></TR | |
502 ><TR | |
503 ><TD | |
504 ><TT | |
505 CLASS="LITERAL" | |
506 >SDL_HAT_DOWN</TT | |
507 ></TD | |
508 ></TR | |
509 ><TR | |
510 ><TD | |
511 ><TT | |
512 CLASS="LITERAL" | |
513 >SDL_HAT_LEFT</TT | |
514 ></TD | |
515 ></TR | |
516 ></TBODY | |
517 ></TABLE | |
518 ><P | |
519 ></P | |
520 > | |
521 | |
522 Also there are some predefined combinations of the above: | |
523 <P | |
524 ></P | |
525 ><TABLE | |
526 BORDER="0" | |
527 ><TBODY | |
528 ><TR | |
529 ><TD | |
530 ><TT | |
531 CLASS="LITERAL" | |
532 >SDL_HAT_RIGHTUP</TT | |
533 ></TD | |
534 ></TR | |
535 ><TR | |
536 ><TD | |
537 ><TT | |
538 CLASS="LITERAL" | |
539 >SDL_HAT_RIGHTDOWN</TT | |
540 ></TD | |
541 ></TR | |
542 ><TR | |
543 ><TD | |
544 ><TT | |
545 CLASS="LITERAL" | |
546 >SDL_HAT_LEFTUP</TT | |
547 ></TD | |
548 ></TR | |
549 ><TR | |
550 ><TD | |
551 ><TT | |
552 CLASS="LITERAL" | |
553 >SDL_HAT_LEFTDOWN</TT | |
554 ></TD | |
555 ></TR | |
556 ></TBODY | |
557 ></TABLE | |
558 ><P | |
559 ></P | |
560 > | |
561 | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
562 Our case for the hat may resemble the following:</P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
563 ><DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
564 CLASS="EXAMPLE" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
565 ><A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
566 NAME="AEN244" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
567 ></A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
568 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
569 ><B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
570 >Example 3-8. Joystick Hat Events</B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
571 ></P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
572 ><PRE |
0 | 573 CLASS="PROGRAMLISTING" |
574 > case SDL_JOYHATMOTION: /* Handle Hat Motion */ | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
575 if ( event.jhat.value & SDL_HAT_UP ) |
0 | 576 { |
577 /* Do up stuff here */ | |
578 } | |
579 | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
580 if ( event.jhat.value & SDL_HAT_LEFT ) |
0 | 581 { |
582 /* Do left stuff here */ | |
583 } | |
584 | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
585 if ( event.jhat.value & SDL_HAT_RIGHTDOWN ) |
0 | 586 { |
587 /* Do right and down together stuff here */ | |
588 } | |
589 break;</PRE | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
590 ></DIV |
0 | 591 ><P |
592 >In addition to the queries for number of joysticks on the system and their names there are additional functions to query the capabilities of attached joysticks: | |
593 <P | |
594 ></P | |
595 ><TABLE | |
596 BORDER="0" | |
597 ><TBODY | |
598 ><TR | |
599 ><TD | |
600 ><A | |
601 HREF="sdljoysticknumaxes.html" | |
602 ><TT | |
603 CLASS="FUNCTION" | |
604 >SDL_JoystickNumAxes</TT | |
605 ></A | |
606 ></TD | |
607 ><TD | |
608 >Returns the number of joysitck axes</TD | |
609 ></TR | |
610 ><TR | |
611 ><TD | |
612 ><A | |
613 HREF="sdljoysticknumbuttons.html" | |
614 ><TT | |
615 CLASS="FUNCTION" | |
616 >SDL_JoystickNumButtons</TT | |
617 ></A | |
618 ></TD | |
619 ><TD | |
620 >Returns the number of joysitck buttons</TD | |
621 ></TR | |
622 ><TR | |
623 ><TD | |
624 ><A | |
625 HREF="sdljoysticknumballs.html" | |
626 ><TT | |
627 CLASS="FUNCTION" | |
628 >SDL_JoystickNumBalls</TT | |
629 ></A | |
630 ></TD | |
631 ><TD | |
632 >Returns the number of joysitck balls</TD | |
633 ></TR | |
634 ><TR | |
635 ><TD | |
636 ><A | |
637 HREF="sdljoysticknumhats.html" | |
638 ><TT | |
639 CLASS="FUNCTION" | |
640 >SDL_JoystickNumHats</TT | |
641 ></A | |
642 ></TD | |
643 ><TD | |
644 >Returns the number of joysitck hats</TD | |
645 ></TR | |
646 ></TBODY | |
647 ></TABLE | |
648 ><P | |
649 ></P | |
650 > | |
651 | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
652 To use these functions we just have to pass in the joystick structure we got when we opened the joystick. For Example:</P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
653 ><DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
654 CLASS="EXAMPLE" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
655 ><A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
656 NAME="AEN265" |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
657 ></A |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
658 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
659 ><B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
660 >Example 3-9. Querying Joystick Characteristics</B |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
661 ></P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
662 ><PRE |
0 | 663 CLASS="PROGRAMLISTING" |
664 > int number_of_buttons; | |
665 SDL_Joystick *joystick; | |
666 | |
667 joystick = SDL_JoystickOpen(0); | |
668 number_of_buttons = SDL_JoystickNumButtons(joystick);</PRE | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
669 ></DIV |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
670 ><P |
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
671 >This block of code would get the number of buttons on the first joystick in the system. </P |
0 | 672 ></DIV |
673 ></DIV | |
674 ></DIV | |
675 ><DIV | |
676 CLASS="NAVFOOTER" | |
677 ><HR | |
678 ALIGN="LEFT" | |
679 WIDTH="100%"><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
680 SUMMARY="Footer navigation table" |
0 | 681 WIDTH="100%" |
682 BORDER="0" | |
683 CELLPADDING="0" | |
684 CELLSPACING="0" | |
685 ><TR | |
686 ><TD | |
687 WIDTH="33%" | |
688 ALIGN="left" | |
689 VALIGN="top" | |
690 ><A | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
691 HREF="guidevideoopengl.html" |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
692 ACCESSKEY="P" |
0 | 693 >Prev</A |
694 ></TD | |
695 ><TD | |
696 WIDTH="34%" | |
697 ALIGN="center" | |
698 VALIGN="top" | |
699 ><A | |
700 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
701 ACCESSKEY="H" |
0 | 702 >Home</A |
703 ></TD | |
704 ><TD | |
705 WIDTH="33%" | |
706 ALIGN="right" | |
707 VALIGN="top" | |
708 ><A | |
709 HREF="guideinputkeyboard.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
710 ACCESSKEY="N" |
0 | 711 >Next</A |
712 ></TD | |
713 ></TR | |
714 ><TR | |
715 ><TD | |
716 WIDTH="33%" | |
717 ALIGN="left" | |
718 VALIGN="top" | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
719 >Using OpenGL With SDL</TD |
0 | 720 ><TD |
721 WIDTH="34%" | |
722 ALIGN="center" | |
723 VALIGN="top" | |
724 ><A | |
725 HREF="guide.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
726 ACCESSKEY="U" |
0 | 727 >Up</A |
728 ></TD | |
729 ><TD | |
730 WIDTH="33%" | |
731 ALIGN="right" | |
732 VALIGN="top" | |
733 >Handling the Keyboard</TD | |
734 ></TR | |
735 ></TABLE | |
736 ></DIV | |
737 ></BODY | |
738 ></HTML | |
739 > |