- Main Page
- Namespaces
- Data Structures
- Files

- Search for |

- File List
- Globals

# HydroSDL/joystick_SDL.cpp File Reference

`#include "SDL.h"`
`#include "joystick_SDL.h"`

Include dependency graph for joystick_SDL.cpp:

Go to the source code of this file.

## Functions
int | joystick_init ()
| Joystick initialisation.
void | joystick_getXYZR (float *X, float *Y, float *Z, float *R, bool doX, bool doY, bool doZ, bool doR)
| Get joystick position.
void | joystick_close ()
| Close joystick.
## Variables
int | numJoy
int | numAxes
SDL_Joystick * | joystick

## Function Documentation

void joystick_close | ( |  | ) |

Close joystick.

If a joystick has been opened, this function closes it...

Definition at line 46 of file joystick_SDL.cpp.

References joystick, and numJoy.

void joystick_getXYZR | ( | float * | X,
|  | float * | Y,
|  | float * | Z,
|  | float * | R,
|  | bool | doX,
|  | bool | doY,
|  | bool | doZ,
|  | bool | doR |
| ) |  |  |

Get joystick position.

Returns the actual joystick position (of selected axes via corresponding boolean doX...Z)

Parameters:

  | doX | : TRUE: get X position and modify the *X value. FALSE: Do not modify *X.
  | doY | : TRUE: get Y position and modify the *Y value. FALSE: Do not modify *Y.
  | doZ | : TRUE: get Z position and modify the *Z value. FALSE: Do not modify *Z.
  | doR | : TRUE: get R position and modify the *R value. FALSE: Do not modify *R.
  | *X | : Adress of the X value to be modified or not.
  | *Y | : Adress of the Y value to be modified or not.
  | *Z | : Adress of the Z value to be modified or not.
  | *R | : Adress of the R value to be modified or not.

Definition at line 33 of file joystick_SDL.cpp.

References f(), joystick, and numAxes.

int joystick_init | ( |  | ) |

Joystick initialisation.

This function tries to open the joystick if one is connected. If no joystick is found, the programm uses keyboard controll

Definition at line 11 of file joystick_SDL.cpp.

References joystick, numAxes, numJoy, and thereIsJoy.

## Variable Documentation

SDL_Joystick* joystick

Definition at line 7 of file joystick_SDL.cpp.

int numAxes

Definition at line 6 of file joystick_SDL.cpp.

int numJoy

Definition at line 5 of file joystick_SDL.cpp.