NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
REL="HOME"
TITLE="SDL Library Documentation"
REL="UP"
TITLE="SDL Reference"
HREF="reference.html"><
LINK
REL="PREVIOUS"
TITLE="SDL_JoystickEventState"
HREF="sdljoystickeventstate.html"><
LINK
REL="NEXT"
TITLE="SDL_NumJoysticks"
HREF="sdlnumjoysticks.html"><
META
NAME="KEYWORD"
NAME="KEYWORD"
CONTENT="function"><
/HEAD
CLASS="CHAPTER"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
CLASS="NAVHEADER"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation<
/TH
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
HREF="sdljoystickeventstate.html"
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
HREF="sdlnumjoysticks.html"
ALIGN="LEFT"
CLASS="CHAPTER"
NAME="JOYSTICK"
CLASS="TOC"
HREF="sdlnumjoysticks.html"
> &#
8212; Count available joysticks.<
/DT
HREF="sdljoystickname.html"
> &#
8212; Get joystick
name.<
/DT
HREF="sdljoystickopen.html"
> &#
8212; Opens a joystick
for use.<
/DT
HREF="sdljoystickopened.html"
> &#
8212; Determine if a joystick has been opened<
/DT
HREF="sdljoystickindex.html"
> &#
8212; Get the index of an SDL_Joystick.<
/DT
HREF="sdljoysticknumaxes.html"
> &#
8212; Get the number of joystick axes<
/DT
HREF="sdljoysticknumballs.html"
> &#
8212; Get the number of joystick trackballs<
/DT
HREF="sdljoysticknumhats.html"
> &#
8212; Get the number of joystick hats<
/DT
HREF="sdljoysticknumbuttons.html"
>SDL_JoystickNumButtons<
/A
> &#
8212; Get the number of joysitck buttons<
/DT
HREF="sdljoystickupdate.html"
> &#
8212; Updates the state of all joysticks<
/DT
HREF="sdljoystickgetaxis.html"
> &#
8212; Get the current state of an axis<
/DT
HREF="sdljoystickgethat.html"
> &#
8212; Get the current state of a joystick hat<
/DT
HREF="sdljoystickgetbutton.html"
>SDL_JoystickGetButton<
/A
> &#
8212; Get the current state of a given button on a given joystick<
/DT
HREF="sdljoystickgetball.html"
> &#
8212; Get relative trackball motion<
/DT
HREF="sdljoystickclose.html"
> &#
8212; Closes a previously opened joystick<
/DT
>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
>Joystick support is initialized by passed the <
TT
CLASS="LITERAL"
HREF="sdlinit.html"
CLASS="FUNCTION"
>. Once initilized joysticks must be opened using <
A
HREF="sdljoystickopen.html"
CLASS="FUNCTION"
>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
HREF="event.html"
>event</A
> system. To enable this, you must set the joystick event processing state with <A
HREF="sdljoystickeventstate.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickEventState</TT
></A
>. Joysticks must be <A
HREF="sdljoystickopen.html"
>opened</A
> before they can be used of course.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>If you are <I
CLASS="EMPHASIS"
>not</I
> handling the joystick via the event queue then you must explicitly request a joystick update by calling <A
HREF="sdljoystickupdate.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickUpdate</TT
></A
>.</P
></BLOCKQUOTE
></DIV
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>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
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdljoystickeventstate.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlnumjoysticks.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_JoystickEventState</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="reference.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_NumJoysticks</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>