install_joystick(3)

NAME
install_joystick

SYNOPSIS
#include <allegro.h>

int install_joystick(int type);

DESCRIPTION
Initialises the joystick, and calibrates the centre position value. The type parameter should usually be JOY_TYPE_AUTODETECT, or see the platform specific documentation for a list of the available drivers. You must call this routine before using any other joystick functions, and you should make sure that the joystick is in the middle position at the time. Returns zero on success. As soon as you have installed the joystick module, you will be able to read the button state and digital (on/off toggle) direction information, which may be enough for some games. If you want to get full analogue input, though, you need to use the calibrate_joystick() functions to measure the exact range of the inputs: see below.

SEE ALSO
remove_joystick(3), load_joystick_data(3), calibrate_joystick(3), calibrate_joystick_name(3), poll_joystick(3)