M-File Help: joystick | View code for joystick

# joystick

Input from joystick

J = joystick() returns a vector of joystick values in the range -1 to +1.

[J,b] = joystick() as above but also returns a vector of button values, either 0 (not pressed) or 1 (pressed).

## Notes

- This is a MEX file that uses SDL (www.libsdl.org) to interface to a standard gaming joystick.
- The length of the vectors J and B depend on the capabilities of the joystick identified when it is first opened.

## See also

joy2tr

© 1990-2014 Peter Corke.