poll_joystick (3) - Linux Manuals
poll_joystick: Polls the joystick. Allegro game programming library.
NAME
poll_joystick - Polls the joystick. Allegro game programming library.SYNOPSIS
#include <allegro.h>
DESCRIPTION
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);