.\" Generated by the Allegro makedoc utility .TH poll_joystick 3alleg4 "version 4.4.3" "Allegro" "Allegro manual" .SH NAME poll_joystick \- Polls the joystick. Allegro game programming library.\& .SH SYNOPSIS .B #include .sp .B int poll_joystick(); .SH 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: .nf 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); .fi .SH "RETURN VALUE" Returns zero on success or a negative number on failure (usually because no joystick driver was installed). .SH SEE ALSO .BR install_joystick (3alleg4), .BR joy (3alleg4), .BR num_joysticks (3alleg4), .BR exjoy (3alleg4)