install_joystick(3)             Allegro manual             install_joystick(3)



NNAAMMEE
       install_joystick - Initialises the joystick. Allegro game programming
       library.

SSYYNNOOPPSSIISS
       ##iinncclluuddee <<aalllleeggrroo..hh>>


       iinntt iinnssttaallll__jjooyyssttiicckk((iinntt ttyyppee));;

DDEESSCCRRIIPPTTIIOONN
       Installs Allegro's joystick handler, and calibrates the centre position
       values. 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 all joysticks are in the
       middle position at the time. Example:

          textout_centre_ex(screen, font,
                            "Center the joystick and press a key",
                            SCREEN_W/2, SCREEN_H/2, red_color, -1);
          readkey();
          if (install_joystick(JOY_TYPE_AUTODETECT) != 0)
             abort_on_error("Error initialising joystick!");

RREETTUURRNN VVAALLUUEE
       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.


SSEEEE AALLSSOO
       rreemmoovvee__jjooyyssttiicckk(3), nnuumm__jjooyyssttiicckkss(3), llooaadd__jjooyyssttiicckk__ddaattaa(3),
       ccaalliibbrraattee__jjooyyssttiicckk(3), ccaalliibbrraattee__jjooyyssttiicckk__nnaammee(3), ppoollll__jjooyyssttiicckk(3),
       eexxjjooyy(3)



Allegro                          version 4.2.3             install_joystick(3)
