poll_joystick (3) - Linux Manuals
poll_joystick: Polls the joystick. Allegro game programming library.
Command to display poll_joystick
manual in Linux: $ man 3 poll_joystick
NAME
poll_joystick - Polls the joystick. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
int poll_joystick();
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);
RETURN VALUE
Returns zero on success or a negative number on failure (usually because
no joystick driver was installed).
Pages related to poll_joystick
- poll_keyboard (3) - Polls the keyboard. Allegro game programming library.
- poll_mouse (3) - Polls the mouse. Allegro game programming library.
- poll_scroll (3) - Checks the status of a scroll request with triple buffering. Allegro game programming library.
- polygon (3) - Draws a filled polygon. Allegro game programming library.
- polygon3d (3) - Draws a 3d polygon onto the specified bitmap. Allegro game programming library.
- polygon3d_f (3) - Draws a 3d polygon onto the specified bitmap. Allegro game programming library.
- polygon_z_normal (3) - Finds the Z component of the normal vector to three vertices. Allegro game programming library.