poll_joystick(3alleg)

poll_joystick3alleg

Polls the joystick. allegro game programming library.

Usage

#include <allegro.h>

int poll_joystick();

Overview

The joystick handler is not interrupt driven, so you need to call this function every now and again to update the global position values. Example:

   do {
      /* Get joystick input */
      poll_joystick();
      /* Process input for the first joystick */
      if (joy[0].button[0].b)
         first_button_pressed();
      if (joy[0].button[1].b)
         second_button_pressed();
      ...
   } while(!done);

Return value

Returns zero on success or a negative number on failure (usually because no joystick driver was installed).

Releases

4 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1
  2. 4.0
  3. 5.0–6.0

From liballegro-doc 2:4.2.2-2.2 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.