Mercurial > sdl-ios-xcode
annotate docs/html/joystick.html @ 2577:72b17d80b426 gsoc2008_force_feedback
Fixed some lone malloc and free.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Thu, 31 Jul 2008 17:27:32 +0000 |
parents | 355632dca928 |
children |
rev | line source |
---|---|
0 | 1 <HTML |
2 ><HEAD | |
3 ><TITLE | |
4 >Joystick</TITLE | |
5 ><META | |
6 NAME="GENERATOR" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
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 Reference" | |
14 HREF="reference.html"><LINK | |
15 REL="PREVIOUS" | |
16 TITLE="SDL_JoystickEventState" | |
17 HREF="sdljoystickeventstate.html"><LINK | |
18 REL="NEXT" | |
19 TITLE="SDL_NumJoysticks" | |
20 HREF="sdlnumjoysticks.html"><META | |
21 NAME="KEYWORD" | |
22 CONTENT="joystick"><META | |
23 NAME="KEYWORD" | |
24 CONTENT="function"></HEAD | |
25 ><BODY | |
26 CLASS="CHAPTER" | |
27 BGCOLOR="#FFF8DC" | |
28 TEXT="#000000" | |
29 LINK="#0000ee" | |
30 VLINK="#551a8b" | |
31 ALINK="#ff0000" | |
32 ><DIV | |
33 CLASS="NAVHEADER" | |
34 ><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
35 SUMMARY="Header navigation table" |
0 | 36 WIDTH="100%" |
37 BORDER="0" | |
38 CELLPADDING="0" | |
39 CELLSPACING="0" | |
40 ><TR | |
41 ><TH | |
42 COLSPAN="3" | |
43 ALIGN="center" | |
44 >SDL Library Documentation</TH | |
45 ></TR | |
46 ><TR | |
47 ><TD | |
48 WIDTH="10%" | |
49 ALIGN="left" | |
50 VALIGN="bottom" | |
51 ><A | |
52 HREF="sdljoystickeventstate.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
53 ACCESSKEY="P" |
0 | 54 >Prev</A |
55 ></TD | |
56 ><TD | |
57 WIDTH="80%" | |
58 ALIGN="center" | |
59 VALIGN="bottom" | |
60 ></TD | |
61 ><TD | |
62 WIDTH="10%" | |
63 ALIGN="right" | |
64 VALIGN="bottom" | |
65 ><A | |
66 HREF="sdlnumjoysticks.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
67 ACCESSKEY="N" |
0 | 68 >Next</A |
69 ></TD | |
70 ></TR | |
71 ></TABLE | |
72 ><HR | |
73 ALIGN="LEFT" | |
74 WIDTH="100%"></DIV | |
75 ><DIV | |
76 CLASS="CHAPTER" | |
77 ><H1 | |
78 ><A | |
79 NAME="JOYSTICK" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
80 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
81 >Chapter 9. Joystick</H1 |
0 | 82 ><DIV |
83 CLASS="TOC" | |
84 ><DL | |
85 ><DT | |
86 ><B | |
87 >Table of Contents</B | |
88 ></DT | |
89 ><DT | |
90 ><A | |
91 HREF="sdlnumjoysticks.html" | |
92 >SDL_NumJoysticks</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
93 > -- Count available joysticks.</DT |
0 | 94 ><DT |
95 ><A | |
96 HREF="sdljoystickname.html" | |
97 >SDL_JoystickName</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
98 > -- Get joystick name.</DT |
0 | 99 ><DT |
100 ><A | |
101 HREF="sdljoystickopen.html" | |
102 >SDL_JoystickOpen</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
103 > -- Opens a joystick for use.</DT |
0 | 104 ><DT |
105 ><A | |
106 HREF="sdljoystickopened.html" | |
107 >SDL_JoystickOpened</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
108 > -- Determine if a joystick has been opened</DT |
0 | 109 ><DT |
110 ><A | |
111 HREF="sdljoystickindex.html" | |
112 >SDL_JoystickIndex</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
113 > -- Get the index of an SDL_Joystick.</DT |
0 | 114 ><DT |
115 ><A | |
116 HREF="sdljoysticknumaxes.html" | |
117 >SDL_JoystickNumAxes</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
118 > -- Get the number of joystick axes</DT |
0 | 119 ><DT |
120 ><A | |
121 HREF="sdljoysticknumballs.html" | |
122 >SDL_JoystickNumBalls</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
123 > -- Get the number of joystick trackballs</DT |
0 | 124 ><DT |
125 ><A | |
126 HREF="sdljoysticknumhats.html" | |
127 >SDL_JoystickNumHats</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
128 > -- Get the number of joystick hats</DT |
0 | 129 ><DT |
130 ><A | |
131 HREF="sdljoysticknumbuttons.html" | |
132 >SDL_JoystickNumButtons</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
133 > -- Get the number of joysitck buttons</DT |
0 | 134 ><DT |
135 ><A | |
136 HREF="sdljoystickupdate.html" | |
137 >SDL_JoystickUpdate</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
138 > -- Updates the state of all joysticks</DT |
0 | 139 ><DT |
140 ><A | |
141 HREF="sdljoystickgetaxis.html" | |
142 >SDL_JoystickGetAxis</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
143 > -- Get the current state of an axis</DT |
0 | 144 ><DT |
145 ><A | |
146 HREF="sdljoystickgethat.html" | |
147 >SDL_JoystickGetHat</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
148 > -- Get the current state of a joystick hat</DT |
0 | 149 ><DT |
150 ><A | |
151 HREF="sdljoystickgetbutton.html" | |
152 >SDL_JoystickGetButton</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
153 > -- Get the current state of a given button on a given joystick</DT |
0 | 154 ><DT |
155 ><A | |
156 HREF="sdljoystickgetball.html" | |
157 >SDL_JoystickGetBall</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
158 > -- Get relative trackball motion</DT |
0 | 159 ><DT |
160 ><A | |
161 HREF="sdljoystickclose.html" | |
162 >SDL_JoystickClose</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
163 > -- Closes a previously opened joystick</DT |
0 | 164 ></DL |
165 ></DIV | |
166 ><P | |
167 >Joysticks, and other similar input devices, have a very strong role in game playing and SDL provides comprehensive support for them. Axes, Buttons, POV Hats and trackballs are all supported.</P | |
168 ><P | |
169 >Joystick support is initialized by passed the <TT | |
170 CLASS="LITERAL" | |
171 >SDL_INIT_JOYSTICK</TT | |
172 > flag to <A | |
173 HREF="sdlinit.html" | |
174 ><TT | |
175 CLASS="FUNCTION" | |
176 >SDL_Init</TT | |
177 ></A | |
178 >. Once initilized joysticks must be opened using <A | |
179 HREF="sdljoystickopen.html" | |
180 ><TT | |
181 CLASS="FUNCTION" | |
182 >SDL_JoystickOpen</TT | |
183 ></A | |
184 >.</P | |
185 ><P | |
186 >While using the functions describe in this secton may seem like the best way to access and read from joysticks, in most cases they aren't. Ideally joysticks should be read using the <A | |
187 HREF="event.html" | |
188 >event</A | |
189 > system. To enable this, you must set the joystick event processing state with <A | |
190 HREF="sdljoystickeventstate.html" | |
191 ><TT | |
192 CLASS="FUNCTION" | |
193 >SDL_JoystickEventState</TT | |
194 ></A | |
195 >. Joysticks must be <A | |
196 HREF="sdljoystickopen.html" | |
197 >opened</A | |
198 > before they can be used of course.</P | |
199 ><DIV | |
200 CLASS="NOTE" | |
201 ><BLOCKQUOTE | |
202 CLASS="NOTE" | |
203 ><P | |
204 ><B | |
205 >Note: </B | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
206 >If you are <SPAN |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
207 CLASS="emphasis" |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
208 ><I |
0 | 209 CLASS="EMPHASIS" |
210 >not</I | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
211 ></SPAN |
0 | 212 > handling the joystick via the event queue then you must explicitly request a joystick update by calling <A |
213 HREF="sdljoystickupdate.html" | |
214 ><TT | |
215 CLASS="FUNCTION" | |
216 >SDL_JoystickUpdate</TT | |
217 ></A | |
218 >.</P | |
219 ></BLOCKQUOTE | |
220 ></DIV | |
221 ><DIV | |
222 CLASS="NOTE" | |
223 ><BLOCKQUOTE | |
224 CLASS="NOTE" | |
225 ><P | |
226 ><B | |
227 >Note: </B | |
228 >Force Feedback is not yet support. Sam (slouken@libsdl.org) is soliciting suggestions from people with force-feedback experience on the best wat to desgin the API.</P | |
229 ></BLOCKQUOTE | |
230 ></DIV | |
231 ></DIV | |
232 ><DIV | |
233 CLASS="NAVFOOTER" | |
234 ><HR | |
235 ALIGN="LEFT" | |
236 WIDTH="100%"><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
237 SUMMARY="Footer navigation table" |
0 | 238 WIDTH="100%" |
239 BORDER="0" | |
240 CELLPADDING="0" | |
241 CELLSPACING="0" | |
242 ><TR | |
243 ><TD | |
244 WIDTH="33%" | |
245 ALIGN="left" | |
246 VALIGN="top" | |
247 ><A | |
248 HREF="sdljoystickeventstate.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
249 ACCESSKEY="P" |
0 | 250 >Prev</A |
251 ></TD | |
252 ><TD | |
253 WIDTH="34%" | |
254 ALIGN="center" | |
255 VALIGN="top" | |
256 ><A | |
257 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
258 ACCESSKEY="H" |
0 | 259 >Home</A |
260 ></TD | |
261 ><TD | |
262 WIDTH="33%" | |
263 ALIGN="right" | |
264 VALIGN="top" | |
265 ><A | |
266 HREF="sdlnumjoysticks.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
267 ACCESSKEY="N" |
0 | 268 >Next</A |
269 ></TD | |
270 ></TR | |
271 ><TR | |
272 ><TD | |
273 WIDTH="33%" | |
274 ALIGN="left" | |
275 VALIGN="top" | |
276 >SDL_JoystickEventState</TD | |
277 ><TD | |
278 WIDTH="34%" | |
279 ALIGN="center" | |
280 VALIGN="top" | |
281 ><A | |
282 HREF="reference.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
283 ACCESSKEY="U" |
0 | 284 >Up</A |
285 ></TD | |
286 ><TD | |
287 WIDTH="33%" | |
288 ALIGN="right" | |
289 VALIGN="top" | |
290 >SDL_NumJoysticks</TD | |
291 ></TR | |
292 ></TABLE | |
293 ></DIV | |
294 ></BODY | |
295 ></HTML | |
296 > |