4 >SDL_JoystickGetAxis
</TITLE
7 CONTENT=
"Modular DocBook HTML Stylesheet Version 1.76b+
10 TITLE=
"SDL Library Documentation"
11 HREF=
"index.html"><LINK
14 HREF=
"joystick.html"><LINK
16 TITLE=
"SDL_JoystickUpdate"
17 HREF=
"sdljoystickupdate.html"><LINK
19 TITLE=
"SDL_JoystickGetHat"
20 HREF=
"sdljoystickgethat.html"></HEAD
31 SUMMARY=
"Header navigation table"
40 >SDL Library Documentation
</TH
48 HREF=
"sdljoystickupdate.html"
62 HREF=
"sdljoystickgethat.html"
73 NAME=
"SDLJOYSTICKGETAXIS"
75 >SDL_JoystickGetAxis
</H1
83 >SDL_JoystickGetAxis
--
Get the current state of an axis
</DIV
85 CLASS=
"REFSYNOPSISDIV"
99 CLASS=
"FUNCSYNOPSISINFO"
100 >#include
"SDL.h"</PRE
107 >SDL_JoystickGetAxis
</B
109 >(SDL_Joystick *joystick, int axis);
</CODE
125 >SDL_JoystickGetAxis
</TT
126 > returns the current state of the given
<TT
138 >On most modern joysticks the X axis is usually represented by
<TT
143 > 0 and the Y axis by
<TT
148 > 1. The value returned by
<TT
150 >SDL_JoystickGetAxis
</TT
151 > is a signed integer (-
32768 to
32768) representing the current position of the
<TT
156 >, it maybe necessary to impose certain tolerances on these values to account for jitter. It is worth noting that some joysticks use axes
2 and
3 for extra buttons.
</P
166 >Returns a
16-bit signed integer representing the current position of the
<TT
182 CLASS=
"PROGRAMLISTING"
183 >Sint16 x_move, y_move;
187 x_move=SDL_JoystickGetAxis(joy1,
0);
188 y_move=SDL_JoystickGetAxis(joy1,
1);
</PRE
200 HREF=
"sdljoysticknumaxes.html"
203 >SDL_JoystickNumAxes
</TT
212 SUMMARY=
"Footer navigation table"
223 HREF=
"sdljoystickupdate.html"
241 HREF=
"sdljoystickgethat.html"
251 >SDL_JoystickUpdate
</TD
265 >SDL_JoystickGetHat
</TD